0
ben.shelton created
- ABP Framework version: v7.2.2
- UI Type: MVC
- Database System: EF Core
- Tiered (for MVC) or Auth Server Separated (for Angular): no
We have a manager that is being called by an appservice in order to do some cross-modules validation checks. If the checks fail, then a BusinessException is thrown. The BusinessExceptions are currently returning Status 403 Forbidden when thrown. Is there a way to make them return Status 400 Bad Request instead?
1 Answer(s)
-
0
hi
- Map your business code to HTTP code. https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/AbpExceptionHttpStatusCodeOptions.cs#L15
- Override the
https://github.com/abpframework/abp/blob/issue-18042/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/DefaultHttpExceptionStatusCodeFinder.cs#L72
service.