onError method
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;
}