You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the State and return some rendered page.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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