question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve information log/response on Exception

See original GitHub issue

There’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.

/cc @guizmaii @smagidson @zmarois

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stijndehaescommented, Jun 21, 2018

Maybe we can make it configurable through config like this(naming still needs to change):

lagom.logging {

	default = "WARN"
	
	exception.logging.level = {
	  "com.lightbend.lagom.javadsl.api.transport.BadRequest" = "WARN"
	  "com.lightbend.lagom.javadsl.api.transport.Forbidden" = "ERROR"
	}
}

This way people can add their own exceptions to the list

0reactions
zmaroiscommented, Jun 25, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found