/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::SageMakerRuntime; using namespace Aws::SageMakerRuntime::Model; namespace Aws { namespace SageMakerRuntime { template<> AWS_SAGEMAKERRUNTIME_API ModelError SageMakerRuntimeError::GetModeledError() { assert(this->GetErrorType() == SageMakerRuntimeErrors::MODEL); return ModelError(this->GetJsonPayload().View()); } namespace SageMakerRuntimeErrorMapper { static const int MODEL_HASH = HashingUtils::HashString("ModelError"); static const int INTERNAL_DEPENDENCY_HASH = HashingUtils::HashString("InternalDependencyException"); static const int MODEL_NOT_READY_HASH = HashingUtils::HashString("ModelNotReadyException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == MODEL_HASH) { return AWSError(static_cast(SageMakerRuntimeErrors::MODEL), false); } else if (hashCode == INTERNAL_DEPENDENCY_HASH) { return AWSError(static_cast(SageMakerRuntimeErrors::INTERNAL_DEPENDENCY), false); } else if (hashCode == MODEL_NOT_READY_HASH) { return AWSError(static_cast(SageMakerRuntimeErrors::MODEL_NOT_READY), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace SageMakerRuntimeErrorMapper } // namespace SageMakerRuntime } // namespace Aws