@@ -37,33 +37,23 @@ private static (int StatusCode, string Message) GetErrorDetails(Exception except
3737 {
3838 return exception switch
3939 {
40- BadRequestException =>
41- ( StatusCodes . Status400BadRequest , exception . Message ) ,
40+ BadRequestException => ( StatusCodes . Status400BadRequest , exception . Message ) ,
4241
43- ForbiddenException =>
44- ( StatusCodes . Status403Forbidden , exception . Message ) ,
42+ ForbiddenException => ( StatusCodes . Status403Forbidden , exception . Message ) ,
4543
46- NotFoundException =>
47- ( StatusCodes . Status404NotFound , exception . Message ) ,
44+ NotFoundException => ( StatusCodes . Status404NotFound , exception . Message ) ,
4845
49- UnauthorizedAccessException =>
50- ( StatusCodes . Status401Unauthorized , exception . Message ) ,
46+ UnauthorizedAccessException => ( StatusCodes . Status401Unauthorized , exception . Message ) ,
5147
52- TimeoutException =>
53- ( StatusCodes . Status408RequestTimeout , exception . Message ) ,
48+ TimeoutException => ( StatusCodes . Status408RequestTimeout , exception . Message ) ,
5449
55- ServiceUnavailableException =>
56- ( StatusCodes . Status503ServiceUnavailable , exception . Message ) ,
50+ ServiceUnavailableException => ( StatusCodes . Status503ServiceUnavailable , exception . Message ) ,
5751
58- NotImplementedException =>
59- ( StatusCodes . Status501NotImplemented , exception . Message ) ,
52+ NotImplementedException => ( StatusCodes . Status501NotImplemented , exception . Message ) ,
6053
61- InternalServerException =>
62- ( StatusCodes . Status500InternalServerError , exception . Message ) ,
54+ InternalServerException => ( StatusCodes . Status500InternalServerError , exception . Message ) ,
6355
64- _ =>
65- ( StatusCodes . Status500InternalServerError ,
66- "An unexpected error occurred while processing your request." )
56+ _ => ( StatusCodes . Status500InternalServerError , "An unexpected error occurred while processing your request." )
6757 } ;
6858 }
6959}
0 commit comments