error property
dynamic
get
error
Returns the current error. Throws if no error is present.
Implementation
dynamic get error {
assert(
_error != null || status == ServiceStatus.failed,
"Error must exist before access.",
);
assert(
status == ServiceStatus.failed,
"Error should only be accessed when [ServiceStatus.failed].",
);
return _error!;
}