webrepl icon indicating copy to clipboard operation
webrepl copied to clipboard

Attempting to GET a non-existent file crashes webrepl on device

Open ARF1 opened this issue 8 years ago • 1 comments

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?

ARF1 avatar Feb 18 '17 20:02 ARF1

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.

pfalcon avatar Feb 18 '17 21:02 pfalcon