Replies: 2 comments 2 replies
-
@jplatte you asked me on Reddit to open a discussion here. Is there anything on the roadmap? |
Beta Was this translation helpful? Give feedback.
-
The current design calls the provided handler and immediately turns the returned value into You can create something to wrap your handlers to construct the responses to have less boilerplate, but then you have to still call that on each handler. One thing I can think of you could theoretically do is to create a dummy |
Beta Was this translation helpful? Give feedback.
-
While the current transformation of
Err(impl IntoResponse)
into a valid response works well for API-like use cases it is less suitable for old school multi page applications. In those use cases both successful and error response contain rendered HTML which often requires access to the state in order to render appropriately (e.g. required templates, template data etc.).As of now, handlers would have to do something along these lines to use ergonomic
?
together with template rendering:This is an eye sore and just boilerplate. I know of
HandleErrorLayer
but I have a hard time getting it to work, i.e. extract theState
and return some rendered page.Beta Was this translation helpful? Give feedback.
All reactions