Class ModelExceptionFilterAttribute
- Namespace
- Magicalizer.Api
- Assembly
- Magicalizer.dll
Converts the exceptions of the model services to the responses:
- FluentValidation.ValidationException to 400 Bad Request with the validation errors.
- ModelNotFoundException to 404 Not Found.
- ModelAlreadyExistsException and ModelInUseException to 409 Conflict.
Other exceptions aren't handled.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method)]
public class ModelExceptionFilterAttribute : ExceptionFilterAttribute, IAsyncExceptionFilter, IExceptionFilter, IOrderedFilter, IFilterMetadata
- Inheritance
-
ModelExceptionFilterAttribute
- Implements
- Inherited Members
Methods
OnException(ExceptionContext)
Called after an action has thrown an Exception.
public override void OnException(ExceptionContext context)
Parameters
contextExceptionContextThe ExceptionContext.