/** * 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::MarketplaceCatalog; namespace Aws { namespace MarketplaceCatalog { namespace MarketplaceCatalogErrorMapper { static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException"); static const int RESOURCE_NOT_SUPPORTED_HASH = HashingUtils::HashString("ResourceNotSupportedException"); static const int INTERNAL_SERVICE_HASH = HashingUtils::HashString("InternalServiceException"); static const int RESOURCE_IN_USE_HASH = HashingUtils::HashString("ResourceInUseException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(MarketplaceCatalogErrors::SERVICE_QUOTA_EXCEEDED), false); } else if (hashCode == RESOURCE_NOT_SUPPORTED_HASH) { return AWSError(static_cast(MarketplaceCatalogErrors::RESOURCE_NOT_SUPPORTED), false); } else if (hashCode == INTERNAL_SERVICE_HASH) { return AWSError(static_cast(MarketplaceCatalogErrors::INTERNAL_SERVICE), false); } else if (hashCode == RESOURCE_IN_USE_HASH) { return AWSError(static_cast(MarketplaceCatalogErrors::RESOURCE_IN_USE), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace MarketplaceCatalogErrorMapper } // namespace MarketplaceCatalog } // namespace Aws