chrysn / aiocoap

The Python CoAP library
Other
264 stars 119 forks source link

Error enhancements #350

Closed chrysn closed 4 months ago

chrysn commented 4 months ago

This should close https://github.com/chrysn/aiocoap/issues/348

@Teufelchen1, does this look good to you?

$ ./aiocoap-client coap://localhost/
Network error: [Errno 111] Connection refused (ECONNREFUSED, received through
errqueue)
Debugging hint: The remote host could be reached, but reported that
the requested port is not open. Check whether a CoAP server is running at the
address, or whether it is running on a different port.
$ ./aiocoap-client 'coap://[2001:db8::1]'
Network error: [Errno 101] Network is unreachable (ENETUNREACH, received
through errqueue)
Debugging hint: No way of contacting the remote network could be found. This
may be due to lack of IPv6 connectivity, lack of a concrete route (eg. trying
to reach a private use network which there is no route to). Tools for debugging
in the next step could be ping or traceroute.
./aiocoap-client 'coap://[fe80::1]'
Network error: [Errno 113] No route to host (EHOSTUNREACH, received through
errqueue)
Debugging hint: No way of contacting the remote host could be found. This could
be because a host on the local network is offline or firewalled. Tools for
debugging in the next step could be ping or traceroute.
$ ./aiocoap-client 'coap://255.255.255.255'
Network error: [Errno 13] Permission denied
Debugging hint: The operating system refused to send the request. For example,
this can occur when attempting to send broadcast requests instead of multicast
requests.