/** * 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::signer; namespace Aws { namespace signer { namespace SignerErrorMapper { static const int NOT_FOUND_HASH = HashingUtils::HashString("NotFoundException"); static const int INTERNAL_SERVICE_ERROR_HASH = HashingUtils::HashString("InternalServiceErrorException"); static const int BAD_REQUEST_HASH = HashingUtils::HashString("BadRequestException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == NOT_FOUND_HASH) { return AWSError(static_cast(SignerErrors::NOT_FOUND), false); } else if (hashCode == INTERNAL_SERVICE_ERROR_HASH) { return AWSError(static_cast(SignerErrors::INTERNAL_SERVICE_ERROR), false); } else if (hashCode == BAD_REQUEST_HASH) { return AWSError(static_cast(SignerErrors::BAD_REQUEST), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace SignerErrorMapper } // namespace signer } // namespace Aws