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.

route(..).throws(...) eats stack trace

See original GitHub issue

Hey, project is really cool, just starting to dig into it… leaps and bounds better than my original plan of having to do hand rolled annotation + processing. One issue I’m running into is that it seems that

apiRouting {
  route("/example").throws(exampleError)

will eat the underlying stack trace, and simply output something similar to

ktor.application - 500 Internal Server Error: POST - /example 

Obvious this isn’t ideal for a variety of reasons 😄

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Wicparcommented, Mar 30, 2021

It actually works properly, the throws catches the exception and handles it as a response as it is no longer considered an error. You can print it in the handler if you need to, there is a parameter that accepts a transform function in apiException

0reactions
unredundantcommented, Mar 30, 2021

Oh I had forgotten about this ticket, I’m going to close it since this is expected behavior

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-router eats stack traces in willTransitionTo (and subsequently ...
I wasn't seeing a stack trace because I was calling Routes.run inside of a promise. ... when you are creating the router, and...
Read more >
Rethrowing exceptions in Java without losing the stack trace
In Java, you just throw the exception you caught, so throw e rather than just throw . Java maintains the stack trace.
Read more >
Why you cannot have C++ exceptions with a stack trace
I work with projects where stack traces are added automatically to exceptions during throw. It works quite well, and in fact I would...
Read more >
Kotlin coroutines stack trace issue - Reddit
The stack trace doesn't represent the true coroutine call stack when the exception was created: calls of functions fun3 and fun2 are absent....
Read more >
I want my pony! Or why you cannot have C++ exceptions with ...
Many modern languages such as Java and C# provide the capability, once an exception is generated, to retrieve the stack trace of all...
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