/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::LakeFormation; namespace Aws { namespace LakeFormation { namespace LakeFormationErrorMapper { static const int OPERATION_TIMEOUT_HASH = HashingUtils::HashString("OperationTimeoutException"); static const int CONCURRENT_MODIFICATION_HASH = HashingUtils::HashString("ConcurrentModificationException"); static const int ALREADY_EXISTS_HASH = HashingUtils::HashString("AlreadyExistsException"); static const int INVALID_INPUT_HASH = HashingUtils::HashString("InvalidInputException"); static const int INTERNAL_SERVICE_HASH = HashingUtils::HashString("InternalServiceException"); static const int ENTITY_NOT_FOUND_HASH = HashingUtils::HashString("EntityNotFoundException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == OPERATION_TIMEOUT_HASH) { return AWSError(static_cast(LakeFormationErrors::OPERATION_TIMEOUT), false); } else if (hashCode == CONCURRENT_MODIFICATION_HASH) { return AWSError(static_cast(LakeFormationErrors::CONCURRENT_MODIFICATION), false); } else if (hashCode == ALREADY_EXISTS_HASH) { return AWSError(static_cast(LakeFormationErrors::ALREADY_EXISTS), false); } else if (hashCode == INVALID_INPUT_HASH) { return AWSError(static_cast(LakeFormationErrors::INVALID_INPUT), false); } else if (hashCode == INTERNAL_SERVICE_HASH) { return AWSError(static_cast(LakeFormationErrors::INTERNAL_SERVICE), false); } else if (hashCode == ENTITY_NOT_FOUND_HASH) { return AWSError(static_cast(LakeFormationErrors::ENTITY_NOT_FOUND), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace LakeFormationErrorMapper } // namespace LakeFormation } // namespace Aws