static ExceptionSupport()

in src/NMS.AMQP/Util/ExceptionSupport.cs [34:75]


        static ExceptionSupport()
        {
            // mapping of amqp .Net Lite error code to NMS exception type

            errTypeMap = new Dictionary<string, Type>();
            errTypeMap.Add(NMSErrorCode.CONNECTION_TIME_OUT, typeof(NMSConnectionException));
            errTypeMap.Add(ErrorCode.ConnectionRedirect, typeof(NMSConnectionException));
            errTypeMap.Add(ErrorCode.ConnectionForced, typeof(NMSConnectionException));
            errTypeMap.Add(ErrorCode.IllegalState, typeof(IllegalStateException));

            errTypeMap.Add(NMSErrorCode.INTERNAL_ERROR, typeof(NMSException));
            errTypeMap.Add(NMSErrorCode.UNKNOWN_ERROR, typeof(NMSException));
            errTypeMap.Add(NMSErrorCode.SESSION_TIME_OUT, typeof(NMSException));
            errTypeMap.Add(NMSErrorCode.LINK_TIME_OUT, typeof(NMSException));
            errTypeMap.Add(ErrorCode.DecodeError, typeof(NMSException));
            errTypeMap.Add(ErrorCode.DetachForced, typeof(NMSException));
            errTypeMap.Add(ErrorCode.ErrantLink, typeof(NMSException));
            errTypeMap.Add(ErrorCode.FrameSizeTooSmall, typeof(NMSConnectionException));
            errTypeMap.Add(ErrorCode.FramingError, typeof(NMSConnectionException));
            errTypeMap.Add(ErrorCode.HandleInUse, typeof(NMSException));
            errTypeMap.Add(ErrorCode.InternalError, typeof(NMSException));
            errTypeMap.Add(ErrorCode.InvalidField, typeof(NMSException));
            errTypeMap.Add(ErrorCode.LinkRedirect, typeof(NMSException));
            errTypeMap.Add(ErrorCode.MessageReleased, typeof(IllegalStateException));
            errTypeMap.Add(ErrorCode.MessageSizeExceeded, typeof(NMSException));
            errTypeMap.Add(ErrorCode.NotAllowed, typeof(NMSException));
            errTypeMap.Add(ErrorCode.NotFound, typeof(InvalidDestinationException));
            errTypeMap.Add(ErrorCode.NotImplemented, typeof(NMSException));
            errTypeMap.Add(ErrorCode.PreconditionFailed, typeof(NMSException));
            errTypeMap.Add(ErrorCode.ResourceDeleted, typeof(NMSException));
            errTypeMap.Add(ErrorCode.ResourceLimitExceeded, typeof(NMSException));
            errTypeMap.Add(ErrorCode.ResourceLocked, typeof(NMSException));
            errTypeMap.Add(ErrorCode.Stolen, typeof(NMSException));
            errTypeMap.Add(ErrorCode.TransactionRollback, typeof(TransactionRolledBackException));
            errTypeMap.Add(ErrorCode.TransactionTimeout, typeof(TransactionInProgressException));
            errTypeMap.Add(ErrorCode.TransactionUnknownId, typeof(TransactionRolledBackException));
            errTypeMap.Add(ErrorCode.TransferLimitExceeded, typeof(NMSException));
            errTypeMap.Add(ErrorCode.UnattachedHandle, typeof(NMSException));
            errTypeMap.Add(ErrorCode.UnauthorizedAccess, typeof(NMSSecurityException));
            errTypeMap.Add(ErrorCode.WindowViolation, typeof(NMSException));
            
        }