Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
856c70d4ac |
@@ -32,6 +32,10 @@ namespace SimApi.Middlewares
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await Next(context);
|
await Next(context);
|
||||||
|
if (context.Response.StatusCode != 200)
|
||||||
|
{
|
||||||
|
throw new SimApiException(context.Response.StatusCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (SimApiException ex)
|
catch (SimApiException ex)
|
||||||
{
|
{
|
||||||
@@ -43,6 +47,7 @@ namespace SimApi.Middlewares
|
|||||||
{
|
{
|
||||||
response.SetCodeMsg(ex.Code, ex.Message);
|
response.SetCodeMsg(ex.Code, ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorResponse(context, response);
|
ErrorResponse(context, response);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user