File tree Expand file tree Collapse file tree 2 files changed +1
-10
lines changed
Expand file tree Collapse file tree 2 files changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -133,13 +133,6 @@ impl From<anyhow::Error> for AxumNope {
133133
134134pub ( crate ) type AxumResult < T > = Result < T , AxumNope > ;
135135
136- /// This function is only necessary because `.option_layer()` changes the error type
137- /// and we need to change it back. Since the axum middleware has no way of returning
138- /// an actual error this function should never actually be called.
139- pub ( crate ) async fn dummy_error_handler ( _err : axum:: BoxError ) -> http:: StatusCode {
140- http:: StatusCode :: INTERNAL_SERVER_ERROR
141- }
142-
143136#[ cfg( test) ]
144137mod tests {
145138 use crate :: test:: wrapper;
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ mod statics;
3131use crate :: { db:: Pool , impl_axum_webpage, Context } ;
3232use anyhow:: Error ;
3333use axum:: {
34- error_handling:: HandleErrorLayer ,
3534 extract:: Extension ,
3635 http:: Request as AxumRequest ,
3736 http:: StatusCode ,
@@ -291,8 +290,7 @@ fn apply_middleware(
291290 . layer ( Extension ( context. config ( ) ?) )
292291 . layer ( Extension ( context. storage ( ) ?) )
293292 . layer ( Extension ( context. repository_stats_updater ( ) ?) )
294- . layer ( HandleErrorLayer :: new ( error:: dummy_error_handler) )
295- . option_layer ( template_data. map ( Extension ) )
293+ . layer ( option_layer ( template_data. map ( Extension ) ) )
296294 . layer ( middleware:: from_fn ( csp:: csp_middleware) )
297295 . layer ( middleware:: from_fn (
298296 page:: web_page:: render_templates_middleware,
You can’t perform that action at this time.
0 commit comments