Last steps
The conclusion of this exception filter.
We have everything we need. Back in the catch()
method, let's define an httpError
and a description
using the recently created method. If the httpError
is undefined, activate the BaseExceptionFilter
.
Then, we should obtain the fields from the httpError
, and the name
and value
of the field that caused the error.
Finally, create a meta
field to hold all the extra information which may help better understand the exception.
The last step is to set up the response
and enable this filter globally, and we're done!
Commit - Creating the database exception filter
Last updated