/** * 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::Health; namespace Aws { namespace Health { namespace HealthErrorMapper { static const int INVALID_PAGINATION_TOKEN_HASH = HashingUtils::HashString("InvalidPaginationToken"); static const int UNSUPPORTED_LOCALE_HASH = HashingUtils::HashString("UnsupportedLocale"); static const int CONCURRENT_MODIFICATION_HASH = HashingUtils::HashString("ConcurrentModificationException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INVALID_PAGINATION_TOKEN_HASH) { return AWSError(static_cast(HealthErrors::INVALID_PAGINATION_TOKEN), false); } else if (hashCode == UNSUPPORTED_LOCALE_HASH) { return AWSError(static_cast(HealthErrors::UNSUPPORTED_LOCALE), false); } else if (hashCode == CONCURRENT_MODIFICATION_HASH) { return AWSError(static_cast(HealthErrors::CONCURRENT_MODIFICATION), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace HealthErrorMapper } // namespace Health } // namespace Aws