@@ -157,8 +157,6 @@ pub enum AxumNope {
157
157
InternalServerError ,
158
158
#[ error( "internal error" ) ]
159
159
InternalError ( #[ from] anyhow:: Error ) ,
160
- #[ error( "internal threading error" ) ]
161
- InternalTokio ( #[ from] tokio:: task:: JoinError ) ,
162
160
}
163
161
164
162
impl IntoResponse for AxumNope {
@@ -221,25 +219,19 @@ impl IntoResponse for AxumNope {
221
219
}
222
220
. into_response ( )
223
221
}
224
- AxumNope :: InternalError ( source) => generate_internal_error_page ( source) . into_response ( ) ,
225
- AxumNope :: InternalTokio ( source) => generate_internal_error_page ( source) . into_response ( ) ,
226
- }
227
- }
228
- }
229
-
230
- fn generate_internal_error_page < E : Into < anyhow:: Error > > ( error : E ) -> impl IntoResponse {
231
- let error = anyhow:: anyhow!( error) ;
232
-
233
- let web_error = crate :: web:: AxumErrorPage {
234
- title : "Internal Server Error" ,
235
- message : Cow :: Owned ( error. to_string ( ) ) ,
236
- status : StatusCode :: INTERNAL_SERVER_ERROR ,
237
- } ;
222
+ AxumNope :: InternalError ( source) => {
223
+ let web_error = crate :: web:: AxumErrorPage {
224
+ title : "Internal Server Error" ,
225
+ message : Cow :: Owned ( source. to_string ( ) ) ,
226
+ status : StatusCode :: INTERNAL_SERVER_ERROR ,
227
+ } ;
238
228
239
- // TODO: check: does the sentry tower layer add the request as context?
240
- crate :: utils:: report_error ( & error) ;
229
+ crate :: utils:: report_error ( & source) ;
241
230
242
- web_error
231
+ web_error. into_response ( )
232
+ }
233
+ }
234
+ }
243
235
}
244
236
245
237
#[ cfg( test) ]
0 commit comments