@@ -157,8 +157,6 @@ pub enum AxumNope {
157157 InternalServerError ,
158158 #[ error( "internal error" ) ]
159159 InternalError ( #[ from] anyhow:: Error ) ,
160- #[ error( "internal threading error" ) ]
161- InternalTokio ( #[ from] tokio:: task:: JoinError ) ,
162160}
163161
164162impl IntoResponse for AxumNope {
@@ -221,25 +219,19 @@ impl IntoResponse for AxumNope {
221219 }
222220 . into_response ( )
223221 }
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+ } ;
238228
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) ;
241230
242- web_error
231+ web_error. into_response ( )
232+ }
233+ }
234+ }
243235}
244236
245237#[ cfg( test) ]
0 commit comments