completeErrorSafe method

bool completeErrorSafe(
  1. Object error, [
  2. StackTrace? stackTrace
])

Calls completeError only if ![isCompleted] and returns true, otherwise just returns false.

Implementation

bool completeErrorSafe(Object error, [StackTrace? stackTrace]) {
  if (!isCompleted) {
    completeError(error, stackTrace);
    return true;
  }
  return false;
}