withException method
Sets the response as having encountered an exception.
exception
: The exception encountered.
status
: Status of the response.
Returns the modified Response object with updated exception status.
Implementation
Response<T> withException(dynamic exception, {Status? status}) {
_status = status;
_exception = exception;
_successful = false;
_error = true;
_message = null;
_loading = false;
return this;
}