onApplicationException method
Implementation
FutureOr<Response> onApplicationException(
PharaohError error,
Request request,
Response response,
) async {
final exception = error.exception;
if (exception is RequestValidationError) {
return response.json(exception, statusCode: HttpStatus.badRequest);
}
return response.internalServerError(exception.toString());
}