-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop Snap7Exception where reasonable #272
Comments
I guess the only left Snap7Exception would be here: Line 78 in ee7ad61
Since this is the main interface to get informations from the underneath snap7? |
Is there anyreason to keep using the informations from the snap7 lib? Having different exceptions in python will be nice for handling errors during development with python-snap7. |
Our interface with snap7 is pretty small for thrown errors and dealing with thrown errors from snap7 in Python is horrible if it "just happens". It is not like a nice "ValueError" is thrown, in case stuff underneath exploded, they are much more ugly. Discussable would be creating new Exceptions/add messages to typical python ones like ValueError and use these...but I believe using builtin ones is enough for our usecases |
there are a couple
|
@lautarodapin i think we should keep all information available to us, that helps debugging problems. Just the class can be a bit more specific but also more Python std based. |
I think we should rely less on
Snap7Exception
, and replace it with common Python exceptions.For example, if a user supplies the wrong type to a function we should raise a
TypeError
.https://docs.python.org/3/library/exceptions.html
We should only raise a
Snap7Exception
if there really is a snap7 specific error, that can not be represented with buildin exceptions.The text was updated successfully, but these errors were encountered: