shoc-backend/Api.SeaHavenIndustries/Filters/ArgumentExceptionFilter.cs
Arthur Bassi 755a95bdc3 fix(work-orders): address PR 13/14/15 board review feedback
Tighten board API contracts (BindRequired, ArgumentException to 400, NotFound to 404), share terminal statuses, harden PATCH/create atomicity and vendor validation, restore migration discovery metadata, and cover remaining regression gaps.
2026-07-17 14:05:34 -03:00

21 lines
574 B
C#

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Api.SeaHavenIndustries.Filters
{
public class ArgumentExceptionFilter : IExceptionFilter
{
public void OnException(ExceptionContext context)
{
if (context.Exception is not ArgumentException ex) return;
context.Result = new BadRequestObjectResult(new
{
status = "Error",
message = ex.Message,
code = 400
});
context.ExceptionHandled = true;
}
}
}