Exemple #1
0
 /// <summary>Writes a remote exception to the stream.</summary>
 /// <param name="v">The remote exception to write.</param>
 public void WriteException(RemoteException v)
 {
     Debug.Assert(InEncapsulation && _current.InstanceType == InstanceType.None);
     Debug.Assert(_format == FormatType.Sliced);
     _current.InstanceType = InstanceType.Exception;
     v.Write(this);
     _current = default;
 }
Exemple #2
0
        /// <summary>Writes a remote exception to the stream.</summary>
        /// <param name="v">The remote exception to write.</param>
        public void WriteException(RemoteException v)
        {
            Debug.Assert(InEncapsulation && _current.InstanceType == InstanceType.None);
            Debug.Assert(_format == FormatType.Sliced);
            Debug.Assert(!(v is ObjectNotExistException));    // temporary
            Debug.Assert(!(v is OperationNotExistException)); // temporary
            Debug.Assert(!(v is UnhandledException));         // temporary

            _current.InstanceType = InstanceType.Exception;
            v.Write(this);
            _current = default;
        }
Exemple #3
0
        /// <summary>Writes a remote exception to the stream.</summary>
        /// <param name="v">The remote exception to write.</param>
        public void WriteException(RemoteException v)
        {
            Debug.Assert(InEncapsulation && _current == null);
            Debug.Assert(_format == FormatType.Sliced);
            Debug.Assert(!(v is ObjectNotExistException));    // temporary
            Debug.Assert(!(v is OperationNotExistException)); // temporary
            Debug.Assert(!(v is UnhandledException));         // temporary
            Push(InstanceType.Exception);

            v.Write(this);
            Pop(null);
        }
Exemple #4
0
        internal static void ReportException(RemoteException ex,
                                             IDispatchObserver?dispatchObserver,
                                             Current current)
        {
            bool unhandledException = ex is UnhandledException;

            if (unhandledException && current.Adapter.Communicator.WarnDispatch)
            {
                Warning((UnhandledException)ex, current);
            }

            if (dispatchObserver != null)
            {
                if (unhandledException)
                {
                    dispatchObserver.Failed((ex.InnerException ?? ex).GetType().FullName ?? "System.Exception");
                }
                else
                {
                    dispatchObserver.RemoteException();
                }
            }
        }