httpErrorHandler function

void httpErrorHandler(
  1. HttpRequest req,
  2. Object? error,
  3. StackTrace stackTrace
)

Implementation

void httpErrorHandler(HttpRequest req, Object? error, StackTrace stackTrace) {
  /// `schema.parse()` in a controller: answer 422 like `req.validate()`
  if (error is dv.ValidationException) {
    error = ValidationException(message: error.errors);
  }
  if (error is Exception || error is Error) {
    Dox().config.errorHandler(error, stackTrace);
  }
  httpResponseHandler(error, req);
}