in aws-iot-domainconfiguration/src/main/java/com/amazonaws/iot/domainconfiguration/ExceptionTranslator.java [25:50]
static BaseHandlerException translateIotExceptionToHandlerException(
final IotException e,
final String operation,
final String domainConfigurationName
) {
if (e instanceof ResourceAlreadyExistsException) {
return new CfnAlreadyExistsException(e);
} else if (e instanceof UnauthorizedException) {
return new CfnAccessDeniedException(operation, e);
} else if (e instanceof ResourceNotFoundException) {
if(StringUtils.isNullOrEmpty(domainConfigurationName)) return new CfnNotFoundException(e);
return new CfnNotFoundException(ResourceModel.TYPE_NAME, domainConfigurationName);
} else if (e instanceof InvalidRequestException) {
return new CfnInvalidRequestException(e.getMessage(), e);
} else if (e instanceof ConflictingResourceUpdateException) {
return new CfnResourceConflictException(e);
} else if (e instanceof ThrottlingException) {
return new CfnThrottlingException(operation, e);
} else if (e instanceof ServiceUnavailableException) {
throw new CfnGeneralServiceException(operation, e);
} else if (e instanceof LimitExceededException) {
throw new CfnServiceLimitExceededException(ResourceModel.TYPE_NAME, e.getMessage());
} else {
return new CfnServiceInternalErrorException(operation, e);
}
}