This repository was archived by the owner on Jun 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,8 @@ pub fn build<E: Into<anyhow::Error>>(err: E) -> Rejection {
99}
1010
1111pub fn pack ( err : anyhow:: Error ) -> Problem {
12- tracing:: info!( "pack: {:#?}" , err) ;
1312 let err = match err. downcast :: < Problem > ( ) {
1413 Ok ( problem) => return problem,
15-
1614 Err ( err) => err,
1715 } ;
1816
@@ -23,7 +21,6 @@ pub fn pack(err: anyhow::Error) -> Problem {
2321 . set_status ( http:: StatusCode :: BAD_REQUEST )
2422 . set_detail ( "The passed credentials were invalid." )
2523 }
26-
2724 auth:: AuthError :: ArgonError => ( ) ,
2825 }
2926 }
@@ -63,6 +60,10 @@ pub async fn unpack(rejection: Rejection) -> Result<impl Reply, Infallible> {
6360 let reply = if rejection. is_not_found ( ) {
6461 let problem = Problem :: with_title_and_type_from_status ( http:: StatusCode :: NOT_FOUND ) ;
6562 reply_from_problem ( & problem)
63+ } else if let Some ( _) = rejection. find :: < warp:: reject:: MethodNotAllowed > ( ) {
64+ let problem =
65+ Problem :: with_title_and_type_from_status ( http:: StatusCode :: METHOD_NOT_ALLOWED ) ;
66+ reply_from_problem ( & problem)
6667 } else if let Some ( problem) = rejection. find :: < Problem > ( ) {
6768 reply_from_problem ( problem)
6869 } else if let Some ( e) = rejection. find :: < warp:: filters:: body:: BodyDeserializeError > ( ) {
You can’t perform that action at this time.
0 commit comments