refactor(ExceptionHandlingMiddleware): update to handle ForbiddenException
This commit is contained in:
parent
6e6af4b667
commit
5f7e040e3e
@ -69,6 +69,11 @@ public class ExceptionHandlingMiddleware
|
||||
message = notFoundEx.Message;
|
||||
break;
|
||||
|
||||
case ForbiddenException forbidEx:
|
||||
context.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||
message = forbidEx.Message;
|
||||
break;
|
||||
|
||||
default:
|
||||
logger.LogError(exception, "Unhandled exception occurred.");
|
||||
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
|
||||
<PackageReference Include="DigitalData.Core.Application" Version="3.3.4" />
|
||||
<PackageReference Include="DigitalData.Core.Exceptions" Version="1.1.0" />
|
||||
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user