Exception filters give you full control over how errors are caught and transformed into responses. They sit at the end of the request lifecycle, catching exceptions thrown anywhere in the request and letting you customize the error response format, status, and logging.
A basic exception filter
{ , , , } ;
()
{
(: , : ) {
ctx = host.();
response = ctx.();
request = ctx.();
status = exception.();
response.(status).({
: status,
: ().(),
: request.,
: exception.,
});
}
}
