You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libcoap-rs currently has rather limited error-handling capabilities. This should be improved.
Description
While libcoap-rs has some error handling support, it falls short in some regards:
No library-internal logging
The log crate would allow library users to use their own logging framework while still allowing us to provide log output
Some errors are silently ignored
While message parsing errors are responded to with an RST message, the library user is not informed of such malformed requests. It might be useful if users could provide callbacks/event handlers for such events
We might want to re-evaluate if there are some places where we panic even though we should return a Result
libcoap is rather limited in its error output: Most functions simply return a value on success and NULL on failure, making it rather hard to pinpoint the exact reason for this error.
Fixing this would probably require some large changes in libcoap as we would have to implement error codes throughout the entire library
Implementation steps
Add some library-internal logging
Integrate the log crate and add logging messages where reasonable
Summary
libcoap-rs currently has rather limited error-handling capabilities. This should be improved.
Description
While libcoap-rs has some error handling support, it falls short in some regards:
log
crate would allow library users to use their own logging framework while still allowing us to provide log outputpanic
even though we should return aResult
NULL
on failure, making it rather hard to pinpoint the exact reason for this error.Implementation steps
log
crate and add logging messages where reasonablecoap_set_log_handler()
)Related Issues/MRs
The text was updated successfully, but these errors were encountered: