Skip to content

Commit

Permalink
Removing some TODO items after some testing confirms the mappings work.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpark-msft committed Nov 17, 2020
1 parent b867ae2 commit 1b96dde
Showing 1 changed file with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1b96dde

Please sign in to comment.