onError method

void onError(
  1. Object error, [
  2. StackTrace? stackTrace
])

Records a load failure. Does not end the span — call end.

Implementation

void onError(Object error, [StackTrace? stackTrace]) {
  if (_ended) return;
  span.recordException(error, stackTrace: stackTrace ?? StackTrace.current);
  span.setStatus(StatusCode.error, error.toString());
  _status = ImageConstants.statusError;
}