case ErrorCodes.UNKNOWN:
if (!exception.getError().getDescription().isPresent())
return exception;
if (exception.getError().getDescription().get().indexOf("Cannot find") == -1)
return exception;
return new ResourceNotFoundException(message, exception);
case ErrorCodes.ZONE_NOT_FOUND:
case ErrorCodes.RESOURCE_RECORD_NOT_FOUND:
case ErrorCodes.ACCOUNT_NOT_FOUND:
case ErrorCodes.POOL_NOT_FOUND:
case ErrorCodes.DIRECTIONALPOOL_NOT_FOUND:
case ErrorCodes.DIRECTIONALPOOL_RECORD_NOT_FOUND:
case ErrorCodes.POOL_RECORD_NOT_FOUND:
case ErrorCodes.GROUP_NOT_FOUND:
return new ResourceNotFoundException(message, exception);
case ErrorCodes.ZONE_ALREADY_EXISTS:
case ErrorCodes.RESOURCE_RECORD_ALREADY_EXISTS:
case ErrorCodes.POOL_ALREADY_EXISTS:
case ErrorCodes.POOL_RECORD_ALREADY_EXISTS:
return new ResourceAlreadyExistsException(message, exception);