chrysn/aiocoap

Erroneous code in exception path

Opened this issue · 0 comments

chrysn commented

AttributeError when raising AnonymousHost:

$ ./aiocoap-rd --proxy-domain proxy.example.net &
$ ./aiocoap-widgets --register coap+ws://localhost:8683 --anyport
[...]
  File "/home/chrysn/git/aiocoap/aiocoap/transports/rfc8323common.py", line 65, in uri_base
    raise error.AnonymousHost("Client side of %s can not be expressed as a URI" % self._ctx._scheme)
                                                                                  ^^^^^^^^^
AttributeError: 'WSRemote' object has no attribute '_ctx'

(It's not surprising that an error is raised, but it should be silent on the server and take the proper error path).

The proper way to fix this on the application side is to add --registery-proxy to the widget invocation, but the 5.00 doesn't tell that.