Improve information log/response on Exception
See original GitHub issueThere’s been quite some work (https://github.com/lagom/lagom/pull/1262, https://github.com/lagom/lagom/pull/1211 and https://github.com/lagom/lagom/pull/1315) with different approaches to tune what information should be available in case of service responses that are not 2xx
values.
In some cases, the same status code is used by different exception (PolicyViolation
vs NotFound
using 404
and the treatment differs). In other user requests, the fact that data is withheld in Mode.Prod
is counterproductive since staging
environments run Lagom in Mode.Prod
but are safe (and expected) to report details in case of failure.
These use cases should be considered in an exception handling overhaul.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Spring Boot - How to log all requests and responses with ...
I've played with @ControllerAdvice and @ExceptionHandler , but as I mentioned, I need to handle all success and error requests in single place...
Read more >console.log(response.body) can break the console output #1648
It seems that the console.log() doesn't do any shell escaping and therefore, the control characters can break the terminal output.
Read more >Best Practices for exceptions - .NET - Microsoft Learn
Learn best practices for exceptions, such as using try/catch/finally, handling common conditions without exceptions, and using predefined .
Read more >8. Errors and Exceptions — Python 3.11.1 documentation
Errors detected during execution are called exceptions and are not ... that allow information about the error to be extracted by handlers for...
Read more >Async/await - The Modern JavaScript Tutorial
If it's an error, an exception is generated — same as if throw error were called ... loadJson('https://javascript.info/no-such-user.json') ...
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
Maybe we can make it configurable through config like this(naming still needs to change):
This way people can add their own exceptions to the list
That’s fine @stijndehaes. Your PR lays our a good start I could tack on status-code-based configuration to, although I’m a little concerned that the status-code-based configuration provides a super-set of the case specific classes, making the mechanism to configure it more-complicated than need be if both exist.