addError method
Adds an error
to the sink.
Must not be called on a closed sink.
Implementation
@override
void addError(Object error, [StackTrace? stackTrace]) {
if (onError case final onError?) {
onError(error, stackTrace);
} else {
Error.throwWithStackTrace(error, stackTrace ?? StackTrace.current);
}
}