@@ -9,7 +9,7 @@ use axum::{
9
9
response:: { IntoResponse , Redirect } ,
10
10
} ;
11
11
use hyper:: StatusCode ;
12
- use mas_axum_utils:: { cookies:: CookieJar , record_error } ;
12
+ use mas_axum_utils:: { GenericError , InternalError , cookies:: CookieJar } ;
13
13
use mas_data_model:: UpstreamOAuthProvider ;
14
14
use mas_oidc_client:: requests:: authorization_code:: AuthorizationRequestData ;
15
15
use mas_router:: { PostAuthAction , UrlBuilder } ;
@@ -41,13 +41,12 @@ impl_from_error_for_route!(mas_storage::RepositoryError);
41
41
42
42
impl IntoResponse for RouteError {
43
43
fn into_response ( self ) -> axum:: response:: Response {
44
- let sentry_event_id = record_error ! ( self , Self :: Internal ( _) ) ;
45
- let response = match self {
46
- Self :: ProviderNotFound => ( StatusCode :: NOT_FOUND , "Provider not found" ) . into_response ( ) ,
47
- Self :: Internal ( e) => ( StatusCode :: INTERNAL_SERVER_ERROR , e. to_string ( ) ) . into_response ( ) ,
48
- } ;
49
-
50
- ( sentry_event_id, response) . into_response ( )
44
+ match self {
45
+ e @ Self :: ProviderNotFound => {
46
+ GenericError :: new ( StatusCode :: NOT_FOUND , e) . into_response ( )
47
+ }
48
+ Self :: Internal ( e) => InternalError :: new ( e) . into_response ( ) ,
49
+ }
51
50
}
52
51
}
53
52
0 commit comments