/** * 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::AppRunner; namespace Aws { namespace AppRunner { namespace AppRunnerErrorMapper { static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException"); static const int INTERNAL_SERVICE_ERROR_HASH = HashingUtils::HashString("InternalServiceErrorException"); static const int INVALID_STATE_HASH = HashingUtils::HashString("InvalidStateException"); static const int INVALID_REQUEST_HASH = HashingUtils::HashString("InvalidRequestException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(AppRunnerErrors::SERVICE_QUOTA_EXCEEDED), false); } else if (hashCode == INTERNAL_SERVICE_ERROR_HASH) { return AWSError(static_cast(AppRunnerErrors::INTERNAL_SERVICE_ERROR), false); } else if (hashCode == INVALID_STATE_HASH) { return AWSError(static_cast(AppRunnerErrors::INVALID_STATE), false); } else if (hashCode == INVALID_REQUEST_HASH) { return AWSError(static_cast(AppRunnerErrors::INVALID_REQUEST), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace AppRunnerErrorMapper } // namespace AppRunner } // namespace Aws