Exemplo n.º 1
0
        protected RemoteExceptionBase(

            RemoteExceptionId id,
            string message           = null,
            Exception innerException = null)
            : base($"[{id}]" + (message ?? (" tnt call exception")), innerException)
        {
            IsFatal   = false;
            MessageId = null;
            AskId     = null;
            Id        = id;
        }
Exemplo n.º 2
0
        public static RemoteExceptionBase Create(RemoteExceptionId type, string additionalInfo, short?messageId,
                                                 short?askId, bool isFatal = false)
        {
            switch (type)
            {
            case RemoteExceptionId.RemoteSideUnhandledException:
                return(new RemoteUnhandledException(messageId, askId, null, additionalInfo));

            case RemoteExceptionId.RemoteSideSerializationException:
                return(new RemoteSerializationException(messageId.Value, askId, isFatal, additionalInfo));

            case RemoteExceptionId.RemoteContractImplementationException:
                return(new RemoteContractImplementationException(messageId.Value, askId, isFatal, additionalInfo));

            default:
                throw new InvalidOperationException(
                          $"Exception type {type} is unknown. Exception message: {additionalInfo}");
            }
        }