diff --git a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusException.java b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusException.java index ef6ea9bf21409..89083820482b8 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusException.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusException.java @@ -69,36 +69,31 @@ private ServiceBusFailureReason getServiceBusFailureReasonFromException(AmqpExce } switch (errorCondition) { - // "MessagingEntityNotFoundError", "MessagingEntityNotFound" case NOT_FOUND: - // TODO: try this one out. return ServiceBusFailureReason.MESSAGING_ENTITY_NOT_FOUND; case MESSAGE_LOCK_LOST: return ServiceBusFailureReason.MESSAGE_LOCK_LOST; case MESSAGE_NOT_FOUND: return ServiceBusFailureReason.MESSAGE_NOT_FOUND; - case LINK_PAYLOAD_SIZE_EXCEEDED: // "MessageTooLargeError", "MessageSizeExceeded" + case LINK_PAYLOAD_SIZE_EXCEEDED: return ServiceBusFailureReason.MESSAGE_SIZE_EXCEEDED; - case ENTITY_ALREADY_EXISTS: // "MessagingEntityAlreadyExistsError", "MessagingEntityAlreadyExists" + case ENTITY_ALREADY_EXISTS: return ServiceBusFailureReason.MESSAGING_ENTITY_ALREADY_EXISTS; - case ENTITY_DISABLED_ERROR: // "MessagingEntityDisabledError", "MessagingEntityDisabled" + case ENTITY_DISABLED_ERROR: return ServiceBusFailureReason.MESSAGING_ENTITY_DISABLED; - case RESOURCE_LIMIT_EXCEEDED: // TODO: "QuotaExceededError", "QuotaExceeded" + case RESOURCE_LIMIT_EXCEEDED: return ServiceBusFailureReason.QUOTA_EXCEEDED; - case SERVER_BUSY_ERROR: // "ServerBusyError", "ServiceBusy" + case SERVER_BUSY_ERROR: return ServiceBusFailureReason.SERVICE_BUSY; - case TIMEOUT_ERROR: // "MessageWaitTimeout", "ServiceTimeout", "OperationTimeoutError", "ServiceTimeout" + case TIMEOUT_ERROR: return ServiceBusFailureReason.SERVICE_TIMEOUT; - case PROTON_IO: // "ServiceCommunicationError", "ServiceCommunicationProblem" - // TODO: making this one up. - // AmqpErrorCondition.ConnectionForced? - return ServiceBusFailureReason.SERVICE_COMMUNICATION_PROBLEM; - case SESSION_CANNOT_BE_LOCKED: // "SessionCannotBeLockedError", "SessionCannotBeLocked" + case SESSION_CANNOT_BE_LOCKED: return ServiceBusFailureReason.SESSION_CANNOT_BE_LOCKED; - case SESSION_LOCK_LOST: // "SessionLockLostError", "SessionLockLost" + case SESSION_LOCK_LOST: return ServiceBusFailureReason.SESSION_LOCK_LOST; - case UNAUTHORIZED_ACCESS: // "UnauthorizedError", "Unauthorized + case UNAUTHORIZED_ACCESS: return ServiceBusFailureReason.UNAUTHORIZED; + case PROTON_IO: // does this mapping make sense? default: return ServiceBusFailureReason.GENERAL_ERROR; }