Example usage for javax.jms JMSException JMSException

List of usage examples for javax.jms JMSException JMSException

Introduction

In this page you can find the example usage for javax.jms JMSException JMSException.

Prototype

public JMSException(String reason, String errorCode) 

Source Link

Document

Constructs a JMSException with the specified reason and error code.

Usage

From source file:com.amazon.sqs.javamessaging.AmazonSQSMessagingClientWrapper.java

private JMSException handleException(AmazonClientException e, String operationName) throws JMSException {
    JMSException jmsException;/* w  ww.  j  a va 2 s.c  om*/
    if (e instanceof AmazonServiceException) {
        AmazonServiceException se = (AmazonServiceException) e;

        if (e instanceof QueueDoesNotExistException) {
            jmsException = new InvalidDestinationException(logAndGetAmazonServiceException(se, operationName),
                    se.getErrorCode());
        } else if (isJMSSecurityException(se)) {
            jmsException = new JMSSecurityException(logAndGetAmazonServiceException(se, operationName),
                    se.getErrorCode());
        } else {
            jmsException = new JMSException(logAndGetAmazonServiceException(se, operationName),
                    se.getErrorCode());
        }

    } else {
        jmsException = new JMSException(logAndGetAmazonClientException(e, operationName));
    }
    jmsException.initCause(e);
    return jmsException;
}