Exceptions.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / TransactionBridge / Microsoft / Transactions / Wsat / Messaging / Exceptions.cs / 1 / Exceptions.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

// Exceptions thrown by WS-AT messaging APIs 

using System; 
 
using System.ServiceModel.Channels;
 
using System.ServiceModel;

namespace Microsoft.Transactions.Wsat.Messaging
{ 
    //
    // Exceptions used during deserialization 
    // 

    class InvalidMessageException : CommunicationException 
    {
        public InvalidMessageException(string message) : base (message) {}
        public InvalidMessageException(string message, Exception inner) : base (message, inner) {}
    } 

    class InvalidCoordinationContextException : CommunicationException 
    { 
        public InvalidCoordinationContextException(string message) : base (message) {}
        public InvalidCoordinationContextException(string message, Exception inner) : base(message, inner) { } 
    }

    class InvalidEnlistmentHeaderException : CommunicationException
    { 
        public InvalidEnlistmentHeaderException(string message) : base (message) {}
        public InvalidEnlistmentHeaderException(string message, Exception inner) : base(message, inner) { } 
    } 

    // 
    // Exceptions used during proxy creation
    //

    class CreateChannelFailureException : Exception 
    {
        public CreateChannelFailureException(string message) : base (message) {} 
        public CreateChannelFailureException(string message, Exception inner) : base(message, inner) { } 
    }
 
    //
    // Exceptions used during initialization
    //
 
    class MessagingInitializationException : Exception
    { 
        public MessagingInitializationException(string message) : base (message) {} 
        public MessagingInitializationException(string message, Exception inner) : base (message, inner) {}
    } 

    //
    // Exceptions used for send operations
    // 

    abstract class WsatMessagingException : Exception 
    { 
        protected WsatMessagingException(string message) : base (message) {}
        protected WsatMessagingException(string message, Exception inner) : base(message, inner) {} 
    }

    class WsatFaultException : WsatMessagingException
    { 
        MessageFault fault;
        string action; 
 
        public WsatFaultException(MessageFault fault, string action)
            : 
            base(GetExceptionMessage(fault))
        {
            this.fault = fault;
            this.action = action; 
        }
 
        static string GetExceptionMessage(MessageFault fault) 
        {
            return SR.GetString(SR.RequestReplyFault, 
                                Library.GetFaultCodeName(fault),
                                Library.GetFaultCodeReason(fault));
        }
 
        public MessageFault Fault
        { 
            get { return this.fault; } 
        }
 
        public string Action
        {
            get { return this.action; }
        } 
    }
 
    class WsatSendFailureException : WsatMessagingException 
    {
        public WsatSendFailureException(Exception inner) : base (inner.Message, inner) {} 
    }

    class WsatReceiveFailureException : WsatMessagingException
    { 
        public WsatReceiveFailureException(string message) : base (message) {}
        public WsatReceiveFailureException(Exception inner) : base (inner.Message, inner) {} 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK