example-client: better error handling
See original GitHub issueThe example client has two conflicting goals:
- provide “production-like” error messages: don’t dump a 300 line stack trace if the network is down
- be a useful debugging tool
For an example of the second I modified the example client to use some real world repositories: the error messages I got were mostly useless – I needed to remove the error handling in the example app to see what the errors were.
So I suggest a couple of things:
- DeserializationError needs an actual error message when it’s raised – failure to deserialize local root metadata currently looks like following, note the missing error message on last line (this can be reproduced by just modifying the local root.json file so it is invalid). This should now be fixed with #1876
$ ./client_example.py download x Found trusted root in /home/jku/.local/share/python-tuf-client-example Failed to download target x:
- Maybe there should be a way to see the actual stack trace, and that should be documented in the error message. So a hypothetical normal failure would look like:
and then using -v would$ ./client_example.py download x Found trusted root in /home/jku/.local/share/python-tuf-client-example Failed to download target x: Failed to transmogrify metadata (For detailed traceback use "-v")
raise e
instead of handling it? This would be a small change in client_example itself
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Maintainable error handling with Feign clients? Not a dream ...
I'm going to use a custom annotation to mark methods or the client class which needs special treatment on its error handling:.
Read more >Handling operation errors - Apollo GraphQL Docs
Apollo Client can encounter a variety of errors when executing operations on your GraphQL server. Apollo Client helps you handle these errors according...
Read more >Advanced error handling techniques - Enterprise Craftsmanship
This post describes some (more) advanced error handling techniques. I'll probably do a series because this topic is large and there's quite ...
Read more >Example client errors - Product Documentation | ServiceNow
Example client errors · Client JavaScript errors · Other client script errors · Script resource links by Sys ID · Script access permissions....
Read more >Handling Exceptions and Faults - WCF | Microsoft Learn
The three essential parts of a good exception message are: ... faultCode values (for example, Client and Server) that can be extended either ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would like to take this up as my first PR.
@jku @lukpueh I have passed verbose as parameter to download function and if the verbose is anything other than default I am printing the stack trace.