/** * 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::S3Outposts; namespace Aws { namespace S3Outposts { namespace S3OutpostsErrorMapper { static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException"); static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException"); static const int OUTPOST_OFFLINE_HASH = HashingUtils::HashString("OutpostOfflineException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CONFLICT_HASH) { return AWSError(static_cast(S3OutpostsErrors::CONFLICT), false); } else if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(S3OutpostsErrors::INTERNAL_SERVER), false); } else if (hashCode == OUTPOST_OFFLINE_HASH) { return AWSError(static_cast(S3OutpostsErrors::OUTPOST_OFFLINE), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace S3OutpostsErrorMapper } // namespace S3Outposts } // namespace Aws