AMQ-5519: use the NOT_FOUND error condition when failing to find a DurableSubscription

https://issues.apache.org/jira/browse/AMQ-5519
This commit is contained in:
Robert Gemmell 2015-01-14 16:47:41 +00:00
parent 5b7213eb82
commit 6466ae2bcf
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,7 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.jms.Destination;
import javax.jms.InvalidClientIDException;
import javax.jms.InvalidDestinationException;
import javax.jms.InvalidSelectorException;
import org.apache.activemq.broker.BrokerService;
@ -1335,6 +1336,8 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
Throwable exception = ((ExceptionResponse) response).getException();
if (exception instanceof SecurityException) {
sender.setCondition(new ErrorCondition(AmqpError.UNAUTHORIZED_ACCESS, exception.getMessage()));
} else if (exception instanceof InvalidDestinationException){
sender.setCondition(new ErrorCondition(AmqpError.NOT_FOUND, exception.getMessage()));
} else {
sender.setCondition(new ErrorCondition(AmqpError.INTERNAL_ERROR, exception.getMessage()));
}