webrepl
webrepl copied to clipboard
Attempting to GET a non-existent file crashes webrepl on device
If one attempts to GET a non-existent file, the webrepl connection crashes. (It disconnects.)
On the UART the following message is printed:
dupterm: Exception in read() method, deactivating: OSError: [Errno 2] ENOENT
Catching invalid filenames (i.e. typos) is probably a must-have feature if non-experts are a target user-group for the webrepl.
I have been looking into the issue and my best guess seems is this line requires catching an exception or verification that the file could be opened.
That said, I am not sure what read() method micropython is talking about. Is there any way of making such error messages a bit more explicit? I.e. by mentioning the object/class that defines the method mentioned?
Is there any way of making such error messages a bit more explicit? I.e. by mentioning the object/class that defines the method mentioned?
No. But such errors indeed should be caught and communicated back to client instead of terminating current webrepl connection.