How to get more specific LensFailure messages?
See original GitHub issueSituation: I get a HTTP/1.1 400 body 'body' must be object
response with an empty body after sending a JSON string to an HttpHandler. I think this message is too generic. Ideally, it should be more specific (give more contextual information).
I had to debug to find out the cause of this exception, which was:
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: "abc"
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Failure management - Serverless Applications Lens
Within AWS Lambda , you can configure Maximum Retry Attempts, Maximum Record Age and Destination on Failure to respectively control retry while processing...
Read more >Server as a function with Kotlin - http4k
Use Lens to Set value in HTTP Request We can use the Lens::inject function to specify the value we want to set into...
Read more >Help to diagnose possible lens failure - Gamecube/Wii Forums
I can put any game in the console and it boots first try, event an old Melee spare disc I have that looks...
Read more >lens-errors: Error handling in lens chains - Hackage
We can probably guess in this example why the failure occured, but in larger more complex traversals it can be pretty tough to...
Read more >Add typesafe 12-factor configuration to http4k apps with ...
Most applications will require a variety of configuration primitive types, which may or may not map to the Java/Kotlin standard types, including: strings...
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
@elifarley I’ve got an even better idea - let’s make it function which will create the response body based on the LensFailure. Then people will be able to use it as they see fit. Thoughts?
Hi Dave,
It looks like we have to act earlier in the creation of the LensFailure. Your change doesn’t seem to work as I expected, as it simply doesn’t have the necessary information (the cause field is null).
Take a look at this screenshot:
As you may have alerady noticed, my PR #117 acts at the very beginning of the chain of events of a LensFailure, capturing the originating exception close to where it’s thrown.
Let me know what you think.