Tanganelli / CoAPthon

CoAPthon is a python library to the CoAP protocol aligned with the RFC
MIT License
224 stars 131 forks source link

No handlers could be found for logger "coapthon.client.coap" catch Exception #128

Open dcomins opened 5 years ago

dcomins commented 5 years ago

Is there any way to catch "No handlers could be found for logger "coapthon.client.coap" Exception" in order not to get stuck when I do not receive the ACK from the CoAP request? The problem is that when the node is far away my Router (I loose communication with it) and I send a CoAP request, the program get stuck because this Exception and I need mandatory to reboot the Router program.

Regards,

Diego Comín

Tanganelli commented 5 years ago

Well, you can even catch the generic exception.

Il giorno mar 13 nov 2018 alle ore 10:17 dcomins notifications@github.com ha scritto:

Is there any way to catch "No handlers could be found for logger "coapthon.client.coap" Exception" in order not to get stuck when I do not receive the ACK from the CoAP request? The problem is that when the node is far away my Router (I loose communication with it) and I send a CoAP request, the program get stuck because this Exception and I need mandatory to reboot the Router program.

Regards,

Diego Comín

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Tanganelli/CoAPthon/issues/128, or mute the thread https://github.com/notifications/unsubscribe-auth/AGb2-kwEeptkzNR2dHns3tsTsNhWJAwDks5uuo4kgaJpZM4YbN-H .

dcomins commented 5 years ago

Where is the exception exactly located in code?

Tanganelli commented 5 years ago

All the logging are expected to be included at the beginning of the corresponding file. In your case at the beginning of client/coap.py.

Il giorno mar 13 nov 2018 alle ore 13:35 dcomins notifications@github.com ha scritto:

Where is the exception exactly located in code?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Tanganelli/CoAPthon/issues/128#issuecomment-438250775, or mute the thread https://github.com/notifications/unsubscribe-auth/AGb2-nFJSItpqDspoM4hiP1vP0WGra0cks5uuryjgaJpZM4YbN-H .

dcomins commented 5 years ago

Ok, I see the piece of code I need to catch:

image

What is the best way to catch the login, could you show a way to catch it in your code? By other way is it possible to modify the timeout of the "No handlers could be found...." exception?

I really appreciate your help Mr. Tanganelli

Regards,

Tanganelli commented 5 years ago

Honestly speaking I don't know if there is a "best way", however, something like:

try:

logging staff

except Exception: pass

should work.

I don't think you could modify the timeout.

Best regards, Giacomo

Il giorno gio 15 nov 2018 alle ore 10:55 dcomins notifications@github.com ha scritto:

Ok, I see the piece of code I need to catch:

[image: image] https://user-images.githubusercontent.com/20353282/48544773-a6888900-e8c4-11e8-9a61-992594bd2640.png

What is the best way to catch the login, could you show a way to catch it in your code? By other way is it possible to modify the timeout of the "No handlers could be found...." exception?

I really appreciate your help Mr. Tanganelli

Regards,

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Tanganelli/CoAPthon/issues/128#issuecomment-438983269, or mute the thread https://github.com/notifications/unsubscribe-auth/AGb2-i8ZyJy8GYujzfKEml6IsucQU7cvks5uvTolgaJpZM4YbN-H .