Pass context to exception handler
Hey, is there a way to pass some context about request to the exception handler via Hono context?
2 Replies
I guess the only way of doing it is to wrap exception and add context? I would like to avoid that since, some of the libraries I use throw exceptions in uncaught promises, which don't allow me to catch them in handler try/catch block.
You can pass this data in the Exception as well as set this in context using
.set
and access it in the onError
using .get