How can I better detect and handle server errors #2804
Unanswered
stormyweathers
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Jan,
First off, thanks for your work in maintaining this library. The code and extensive discussions around it have been very helpful to me over the last year.
[Pymodbus 3.8.6]
Lately, I've been developing a modbus server device, and encountered issues when trying to use it on a multi-drop bus. I encountered Issue #2556, where you mentioned this is not supported behavior. Ok, I think I understand why this would be hard to support, and I have since moved my server to a dedicated network to avoid this issue.
However, this error did not cause my program to crash, instead I only noticed by the stacktrace printed in the logs, and then my server refusing communication afterwards.
I am concerned that some other future error could silently break my program.
But since the exception is handled somewhere deep (perhaps the asyncio library, perhaps pymodbus?), I am unable to handle it myself.
I am starting the server using an adaptation of one of the examples:
where
mfchas a method:Could you offer some advice on this?
One option would be to add a special logging handler to detect this issue, i.e.:
This feels wrong to me, but I don't know a better way.
I'd rather "un-handle" the exception, so the program crashes, and can then be restarted,
Beta Was this translation helpful? Give feedback.
All reactions