throwError method

void throwError(
  1. int status, {
  2. String? message,
  3. StackTrace? stackTrace,
  4. Exception? exception,
})

Throw HttpError with status code, message and stackTrace and error

Implementation

void throwError(
  int status, {
  String? message,
  StackTrace? stackTrace,
  Exception? exception,
}) {
  error = HttpError(
    status,
    message: message,
    stackTrace: stackTrace,
    exception: exception,
  );
  throw error!;
}