Skip to content

HTTPErrorHandler stacktrace #2278

Answered by aldas
koi-tattoo asked this question in Q&A
Discussion options

You must be logged in to vote

The way handler/middleware chain works makes it not possible to have stacktrace as error value is returned - and calling methods/functions do not have in Go any mechanism of knowing what the method call stack was when that particular (error) object was created. unless the place that created what error encapsulates stacktrace there.

Basically you have to adopt Go way and let go of Java etc exceptions and their stacktraces or start initiating error objects with by embedding stack information at the time when that error object is created.

I think there is somewhere blogpost or something from Go authors that if you want something tracelike - start wrapping errors places where you handle them.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by koi-tattoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants