internal static UIWidgetsErrorDetails _debugReportException( string context, Exception exception, InformationCollector informationCollector = null ) { var details = new UIWidgetsErrorDetails( exception: exception, library: "widgets library", context: context, informationCollector: informationCollector ); UIWidgetsError.reportError(details); return(details); }
void _rebuild() { try { _child = updateChild(_child, widget.child, _rootChildSlot); // allow } catch (Exception ex) { var details = new UIWidgetsErrorDetails( exception: ex, library: "widgets library", context: new ErrorDescription("attaching to the render tree") ); UIWidgetsError.reportError(details); Widget error = ErrorWidget.builder(details); _child = updateChild(null, error, _rootChildSlot); } }
protected void reportError( DiagnosticsNode context = null, Exception exception = null, InformationCollector informationCollector = null, bool silent = false) { _currentError = new UIWidgetsErrorDetails( exception: exception, library: "image resource service", context: context, informationCollector: informationCollector, silent: silent ); var localErrorListeners = LinqUtils <ImageErrorListener> .WhereList( LinqUtils <ImageErrorListener, ImageStreamListener> .SelectList(_listeners, (l => l.onError)), (l => l != null)); if (localErrorListeners.isEmpty()) { UIWidgetsError.reportError(_currentError); } else { foreach (var errorListener in localErrorListeners) { try { errorListener(exception); } catch (Exception ex) { UIWidgetsError.reportError( new UIWidgetsErrorDetails( context: new ErrorDescription("when reporting an error to an image listener"), library: "image resource service", exception: ex ) ); } } } }
protected void reportError( string context = null, Exception exception = null, InformationCollector informationCollector = null, bool silent = false) { this.currentError = new UIWidgetsErrorDetails( exception: exception, library: "image resource service", context: context, informationCollector: informationCollector, silent: silent ); var localErrorListeners = this._listeners.Select(l => l.errorListener).Where(l => l != null).ToList(); if (localErrorListeners.isEmpty()) { UIWidgetsError.reportError(this.currentError); } else { foreach (var errorListener in localErrorListeners) { try { errorListener(exception); } catch (Exception ex) { UIWidgetsError.reportError( new UIWidgetsErrorDetails( context: "when reporting an error to an image listener", library: "image resource service", exception: ex ) ); } } } }