/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include #include #include using namespace Aws::Client; using namespace Aws::Firehose; using namespace Aws::Utils; namespace Aws { namespace Firehose { namespace FirehoseErrorMapper { static const int INVALID_ARGUMENT_HASH = HashingUtils::HashString("InvalidArgumentException"); static const int CONCURRENT_MODIFICATION_HASH = HashingUtils::HashString("ConcurrentModificationException"); static const int RESOURCE_IN_USE_HASH = HashingUtils::HashString("ResourceInUseException"); static const int LIMIT_EXCEEDED_HASH = HashingUtils::HashString("LimitExceededException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INVALID_ARGUMENT_HASH) { return AWSError(static_cast(FirehoseErrors::INVALID_ARGUMENT), false); } else if (hashCode == CONCURRENT_MODIFICATION_HASH) { return AWSError(static_cast(FirehoseErrors::CONCURRENT_MODIFICATION), false); } else if (hashCode == RESOURCE_IN_USE_HASH) { return AWSError(static_cast(FirehoseErrors::RESOURCE_IN_USE), false); } else if (hashCode == LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(FirehoseErrors::LIMIT_EXCEEDED), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace FirehoseErrorMapper } // namespace Firehose } // namespace Aws