Catching lambda doesn't output the excpetion's message
See original GitHub issueIf I assert expectThat(catching { ... }).isNull()
, and it throws, it doesn’t print the exception’s message…
In my case:
▼ Expect that com.squareup.moshi.JsonDataException:
✗ is null
which doesn’t help too much to identify the source of the problem.
As a plus, it would be nice to have expectDoesNotThrow { }
, that would allow to add more checks on a valid result.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
AWS Lambda function errors in Python
If Lambda encounters an error, it returns an exception type, message, and HTTP status code that indicates the cause of the error. The...
Read more >AWS Step Functions: On Lambda exception, get original input?
1 Answer 1 ... You can do this using ResultPath in Catch clause which will put the exception output into a specific path...
Read more >Avoid print exception to CloudWatch when lambda failed #578
Hi, when I throw an exception from my C# handler in AWS Lambda it is printing the exception to CloudWatch. I there any...
Read more >Net Core Lambda - log caught exceptions - Agents
Currently we are just outputting caught exceptions into the log, but we still want to log them into the errors for analysis.
Read more >Learning Lambda — Part 7 | The Symphonium - Symphonia
In certain situations you really will want to block further event processing until the problem causing the error is resolved, in which case...
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
Fixed with new
expectCatching
…failed
construct (or existingexpectThrows
).I’m working on something at the moment that does away with
catching
altogether. Kotlin already has therunCatching
method. Instead of dealing with an exception ornull
we can userunCatching
to produce aResult<T>
that is either the value (as returned by the lambda) or the exception it threw. I think this makes much more sense for asserting against.e.g.
or
The existing
expectThrows
becomes a shorthand for the first form.See #169