File tree 2 files changed +1
-10
lines changed
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 {
133
133
134
134
pub ( crate ) type AxumResult < T > = Result < T , AxumNope > ;
135
135
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
-
143
136
#[ cfg( test) ]
144
137
mod tests {
145
138
use crate :: test:: wrapper;
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ mod statics;
31
31
use crate :: { db:: Pool , impl_axum_webpage, Context } ;
32
32
use anyhow:: Error ;
33
33
use axum:: {
34
- error_handling:: HandleErrorLayer ,
35
34
extract:: Extension ,
36
35
http:: Request as AxumRequest ,
37
36
http:: StatusCode ,
@@ -291,8 +290,7 @@ fn apply_middleware(
291
290
. layer ( Extension ( context. config ( ) ?) )
292
291
. layer ( Extension ( context. storage ( ) ?) )
293
292
. 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 ) ) )
296
294
. layer ( middleware:: from_fn ( csp:: csp_middleware) )
297
295
. layer ( middleware:: from_fn (
298
296
page:: web_page:: render_templates_middleware,
You can’t perform that action at this time.
0 commit comments