Example usage for javax.jms InvalidDestinationException InvalidDestinationException

List of usage examples for javax.jms InvalidDestinationException InvalidDestinationException

Introduction

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

Prototype

public InvalidDestinationException(String reason, String errorCode) 

Source Link

Document

Constructs an InvalidDestinationException 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;//from   w  w  w.  j  a  v a 2  s . c  o  m
    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;
}