HttpError constructor
HttpError(
- int _status, {
- String? message,
- StackTrace? stackTrace,
- Exception? exception,
Create HttpError object status - response code
Optional parameters
message
- text message of code
exception
- Exception objects thrown in the case of a program failure
stackTrace
- StackTrace by all stack trace objects
Implementation
HttpError(
this._status, {
String? message,
StackTrace? stackTrace,
Exception? exception,
}) : assert(_status >= 400 && _status <= 600,
'The status should be an error code: 400-600') {
_message = message ?? _codes[_status] ?? 'Unknown error';
_stackTrace = stackTrace;
_exception = exception;
}