@@ -9,7 +9,7 @@ use axum::{
9
9
response:: IntoResponse ,
10
10
} ;
11
11
use hyper:: StatusCode ;
12
- use mas_axum_utils:: record_error;
12
+ use mas_axum_utils:: { GenericError , InternalError , record_error} ;
13
13
use mas_router:: { CompatLoginSsoAction , CompatLoginSsoComplete , UrlBuilder } ;
14
14
use mas_storage:: { BoxClock , BoxRepository , BoxRng , compat:: CompatSsoLoginRepository } ;
15
15
use rand:: distributions:: { Alphanumeric , DistString } ;
@@ -43,12 +43,12 @@ impl_from_error_for_route!(mas_storage::RepositoryError);
43
43
44
44
impl IntoResponse for RouteError {
45
45
fn into_response ( self ) -> axum:: response:: Response {
46
- let sentry_event_id = record_error ! ( self , Self :: Internal ( _ ) ) ;
47
- let status_code = match & self {
48
- Self :: Internal ( _ ) => StatusCode :: INTERNAL_SERVER_ERROR ,
49
- Self :: MissingRedirectUrl | Self :: InvalidRedirectUrl => StatusCode :: BAD_REQUEST ,
50
- } ;
51
- ( status_code , sentry_event_id , format ! ( "{self}" ) ) . into_response ( )
46
+ match self {
47
+ Self :: Internal ( e ) => InternalError :: new ( e ) . into_response ( ) ,
48
+ Self :: MissingRedirectUrl | Self :: InvalidRedirectUrl => {
49
+ GenericError :: new ( StatusCode :: BAD_REQUEST , self ) . into_response ( )
50
+ }
51
+ }
52
52
}
53
53
}
54
54
0 commit comments