/** * 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::AlexaForBusiness; namespace Aws { namespace AlexaForBusiness { namespace AlexaForBusinessErrorMapper { static const int LIMIT_EXCEEDED_HASH = HashingUtils::HashString("LimitExceededException"); static const int ALREADY_EXISTS_HASH = HashingUtils::HashString("AlreadyExistsException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(AlexaForBusinessErrors::LIMIT_EXCEEDED), true); } else if (hashCode == ALREADY_EXISTS_HASH) { return AWSError(static_cast(AlexaForBusinessErrors::ALREADY_EXISTS), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace AlexaForBusinessErrorMapper } // namespace AlexaForBusiness } // namespace Aws