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.

How to get more specific LensFailure messages?

See original GitHub issue

Situation: 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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
daviddentoncommented, Apr 6, 2018

@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?

1reaction
elifarleycommented, Apr 13, 2018

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: image

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.

Read more comments on GitHub >

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

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