-
Notifications
You must be signed in to change notification settings - Fork 179
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
target: improve exceptions #1270
target: improve exceptions #1270
Conversation
labgrid's exceptions are already hard to understand, so at least use the short-hand version of the class name in the error messages. Example: NoDriverFoundError: multiple drivers matching <class 'labgrid.protocol.consoleprotocol.ConsoleProtocol'> found in Target(name='main', env=Environment(config_file='env.yaml')) with the same priorities ..becomes.. NoDriverFoundError: multiple drivers matching ConsoleProtocol found in Target(name='main', env=Environment(config_file='env.yaml')) with the same priorities Signed-off-by: Bastian Krause <[email protected]>
NoSupplierFoundError and its sub classes are hard to understand if the driver/strategy causing it is not mentioned: NoDriverFoundError: multiple drivers matching ConsoleProtocol found in Target(name='main', env=Environment(config_file='env.yaml')) with the same priorities Improve this by rasing a more detailed exception from the original exception with this information included: NoDriverFoundError: binding MyStrategy failed: multiple drivers matching ConsoleProtocol found in Target(name='main', env=Environment(config_file='env.yaml')) with the same priorities Signed-off-by: Bastian Krause <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1270 +/- ##
======================================
Coverage 63.0% 63.0%
======================================
Files 160 160
Lines 11848 11851 +3
======================================
+ Hits 7472 7476 +4
+ Misses 4376 4375 -1
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it will be much more helpful
Since this changes the exception string only and the PR is open for a while now, I'll merge this without second approval. |
Description
Use short-hand class names and add driver causing
NoSupplierFoundErrors
in error messages.Checklist