Esempio n. 1
0
//
        internal static void _addErrorWithReplacement <T>(_EventSink <T> sink, Exception error, string stackTrace)
        {
            AsyncError replacement = Zone.current.errorCallback(error);

            if (replacement != null)
            {
                error      = async_._nonNullError(replacement);
                stackTrace = replacement.StackTrace;
            }

            sink._addError(error, stackTrace);
        }
Esempio n. 2
0
        internal override void _handleError(object error, _EventSink <T> sink)
        {
            bool matches = true;

            if (_test != null)
            {
                try {
                    matches = _test((Exception)error);
                }
                catch (Exception e) {
                    _stream._addErrorWithReplacement(sink, e, e.StackTrace);
                    return;
                }
            }

            string stackTrace = error is Exception ? ((Exception)error).StackTrace : "";

            if (matches)
            {
                try {
                    _async._invokeErrorHandler(_transform, error, stackTrace);
                }
                catch (Exception e) {
                    if (Equals(e, error))
                    {
                        sink._addError(error, stackTrace);
                    }
                    else
                    {
                        _stream._addErrorWithReplacement(sink, e, e.StackTrace);
                    }

                    return;
                }
            }
            else
            {
                sink._addError(error, stackTrace);
            }
        }
Esempio n. 3
0
 public override void addError(object error, string stackTrace)
 {
     _sink._addError(error, stackTrace ?? AsyncError.defaultStackTrace(error));
 }
Esempio n. 4
0
        internal virtual void _handleError(object error, _EventSink <T> sink)
        {
            string stackTrace = error is Exception ? ((Exception)error).StackTrace : "";

            sink._addError(error, stackTrace);
        }