addError method
Reports an error
which triggers onError with an optional StackTrace.
If close has already been called, any subsequent calls to addError
will be ignored and will not result in any subsequent state changes.
Implementation
@override
void addError(Object error, [StackTrace? stackTrace]) =>
onError(error, stackTrace ?? StackTrace.current);