error property

Object get error

Returns the current error. Throws if no error is present.

Implementation

Object get error {
  assert(
    _error != null || status == .failed,
    "Error must exist before access.",
  );
  assert(
    status == .failed,
    "Error should only be accessed when ServiceStatus.failed.",
  );

  return _error!;
}