doesNotThrow swallows stacktrace info
See original GitHub issueGiven a method that possibly throws an exception, I get the following stacktrace by wrapping it inside doesNotThrow:
AssertionError: expected [Function] to not throw an error but 'AssertionError: expected [<...>] to be a function' was thrown
at Context.<method> (<file>:<line>:<char>)
if I just run the function without wrapping it
<Class> <method>:
AssertionError: expected [<...>] to be a function
at <Class>.<method> (<file>:<line>:<char>) <----------This line is missing from above
at <Context>.<method> (<file>:<line>:<char>)
Issue Analytics
- State:
- Created 9 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Rescuing a swallowed Exception in Java - Stack Overflow
You can do it without reflection or AOP. The main idea is to throw another (unchecked) exception in the constructor of SomeException ....
Read more >Schema stitching swallows original error stack traces from the ...
But in this merge step, the schema stiching swallows the original error so it's almost impossible to debug an error (no stack trace)....
Read more >Exceptions Rule Set | Detekt
Rules in this rule set report issues related to how code throws and handles ... This rule reports code that tries to print...
Read more >PowerShell: Everything you wanted to know about exceptions
Index. Index; Basic terminology. Exception; Throw and Catch; The call stack; Terminating and non-terminating errors; Swallowing an exception.
Read more >ERR01-J. Do not allow exceptions to expose sensitive ...
Failure to filter sensitive information when propagating exceptions often results ... the exception's message and stack trace are displayed on the console; ...
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
Thanks everyone for input on this issue!
We’ve added this to our Roadmap https://github.com/chaijs/chai/projects/2! We’ll be releasing chai 5 soon, but for now I’ll close this issue because it is tracked on our roadmap.
@keithamus This one isn’t closed by it. There’s actually a couple posts between @lucasfcosta and I near the bottom of https://github.com/chaijs/chai/pull/683 where we list which ones can be closed. 😄