Ejemplo n.º 1
0
        public static void Handle(FaultException faultException)
        {
            Exception innerException = null;
            if (faultException is FaultException<StockFault>)
            {
                var fault = faultException as FaultException<StockFault>;
                innerException = new StockException(fault.Message);
            }

            if (innerException == null)
            {
                throw faultException;
            }

            throw new StockException("A exception has occured.",innerException);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RecordNotFoundFault"/> class.
 /// </summary>
 /// <param name="exception">The exception.</param>
 public StockFault(StockException exception)
 {
     Method = exception.Method;
     ErrorCode = exception.ErrorCode;
 }