This maybe more a question than a bug/feature request.
The error handler I'm trying to implement has some logic based on the incoming request that generated the error.
If building it from scratch (so implementing Dream.error -> Dream.response option Lwt.t) then it's all good, I have the (optional) request in error.request. But I'm missing all the bells an whistle that come with the default error handler. (Smart logging and stack trace in debug mode.)
If I try to go through the template instead (so implementing string option -> response -> response Lwt.t) I lose access to all the request inputs.
I can see how to workaround the problem for reponse based errors I generated by adding the required data to the reponse locals. But that only cover part of the errors, and it doesn't work for the reponses generated by another middleware (e.g. Dream.not_found)
Is there something I'm missing?
Is there a way for me to access the logging and backtrace printing without using the error template?
This maybe more a question than a bug/feature request.
The error handler I'm trying to implement has some logic based on the incoming request that generated the error.
If building it from scratch (so implementing
Dream.error -> Dream.response option Lwt.t) then it's all good, I have the (optional) request inerror.request. But I'm missing all the bells an whistle that come with the default error handler. (Smart logging and stack trace in debug mode.)If I try to go through the template instead (so implementing
string option -> response -> response Lwt.t) I lose access to all the request inputs.I can see how to workaround the problem for reponse based errors I generated by adding the required data to the reponse locals. But that only cover part of the errors, and it doesn't work for the reponses generated by another middleware (e.g.
Dream.not_found)Is there something I'm missing?
Is there a way for me to access the logging and backtrace printing without using the error template?