/** * 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::Batch; namespace Aws { namespace Batch { namespace BatchErrorMapper { static const int CLIENT_HASH = HashingUtils::HashString("ClientException"); static const int SERVER_HASH = HashingUtils::HashString("ServerException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CLIENT_HASH) { return AWSError(static_cast(BatchErrors::CLIENT), false); } else if (hashCode == SERVER_HASH) { return AWSError(static_cast(BatchErrors::SERVER), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace BatchErrorMapper } // namespace Batch } // namespace Aws