Replies: 2 comments 5 replies
-
@garumble this basically means that the client opened a connection but did not send a complete request. The error is being handled for you, and for that reason Microdot does not crash and remains running. The handling logs the exception, because it is unexpected. Do you know what might the client be doing that causes this? What is the client? Browser or something else? Also to clarify, this happens outside of your request handlers, it happens while a request is being received. The error handlers that you configure in your application are intended to catch errors in the handlers themselves, so they do not apply in this case. |
Beta Was this translation helpful? Give feedback.
-
There is only one system that should be connecting to the device. It is a custom application written in C#. However, I don't know if that is in fact the application that is making the request that causes the exception. Normally the application is only listening for requests originating from the device. It is only initiates a request due to an action by a user. These exceptions occur randomly throughout the day without any user action having taken place. |
Beta Was this translation helpful? Give feedback.
-
I routinely get hit with a request that gets an ECONNRESET and eventually I run out of memory. I'm running on an Pico W with the latest microdot.
The error looks like this:
[C]: 11-21-2024 12:11:48 - Traceback (most recent call last):
[C]: 11-21-2024 12:11:48 - File "microdot.py", line 1334, in handle_request
[C]: 11-21-2024 12:11:48 - File "microdot.py", line 401, in create
[C]: 11-21-2024 12:11:49 - File "microdot.py", line 515, in _safe_readline
[C]: 11-21-2024 12:11:49 - File "uasyncio/stream.py", line , in readline
[C]: 11-21-2024 12:11:49 - OSError: [Errno 104] ECONNRESET
Is there a graceful way this I should be using to handle this?
I tried implementing
@app.errorhandler(OSError)
async def runtime_error(request, exception):
But it never gets called.
Beta Was this translation helpful? Give feedback.
All reactions