/** * 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::KinesisVideoWebRTCStorage; namespace Aws { namespace KinesisVideoWebRTCStorage { namespace KinesisVideoWebRTCStorageErrorMapper { static const int CLIENT_LIMIT_EXCEEDED_HASH = HashingUtils::HashString("ClientLimitExceededException"); static const int INVALID_ARGUMENT_HASH = HashingUtils::HashString("InvalidArgumentException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CLIENT_LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(KinesisVideoWebRTCStorageErrors::CLIENT_LIMIT_EXCEEDED), false); } else if (hashCode == INVALID_ARGUMENT_HASH) { return AWSError(static_cast(KinesisVideoWebRTCStorageErrors::INVALID_ARGUMENT), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace KinesisVideoWebRTCStorageErrorMapper } // namespace KinesisVideoWebRTCStorage } // namespace Aws