error property Null safety

Object error
override

Returns last emitted error, failing if there is no error.

Throws ValueStreamError if this Stream has no error.

Implementation

@override
Object get error {
  final errorAndSt = _wrapper.errorAndStackTrace;
  if (errorAndSt != null) {
    return errorAndSt.error;
  }
  throw ValueStreamError.hasNoError();
}