Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changelog/bugfix-cbor-modeled-errors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "bugfix",
"category": "aws-cpp-sdk-core",
"contributor": "sbiscigl",
"description": "Generate GetModeledError for rpcv2Cbor errors that have members beyond Message"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@
*/

#include <aws/application-insights/ApplicationInsightsErrors.h>
#include <aws/application-insights/model/TooManyTagsException.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/cbor/CborValue.h>

using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::ApplicationInsights;
using namespace Aws::ApplicationInsights::Model;

namespace Aws {
namespace ApplicationInsights {
template <>
AWS_APPLICATIONINSIGHTS_API TooManyTagsException ApplicationInsightsError::GetModeledError() {
assert(this->GetErrorType() == ApplicationInsightsErrors::TOO_MANY_TAGS);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return TooManyTagsException(payload.GetDecoder());
}

namespace ApplicationInsightsErrorMapper {

static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,30 @@
*/

#include <aws/arc-region-switch/ARCRegionswitchErrors.h>
#include <aws/arc-region-switch/model/ConflictException.h>
#include <aws/arc-region-switch/model/RetryableConflictException.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>

using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::ARCRegionswitch;
using namespace Aws::ARCRegionswitch::Model;

namespace Aws {
namespace ARCRegionswitch {
template <>
AWS_ARCREGIONSWITCH_API ConflictException ARCRegionswitchError::GetModeledError() {
assert(this->GetErrorType() == ARCRegionswitchErrors::CONFLICT);
return ConflictException(this->GetJsonPayload().View());
}

template <>
AWS_ARCREGIONSWITCH_API RetryableConflictException ARCRegionswitchError::GetModeledError() {
assert(this->GetErrorType() == ARCRegionswitchErrors::RETRYABLE_CONFLICT);
return RetryableConflictException(this->GetJsonPayload().View());
}

namespace ARCRegionswitchErrorMapper {

static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,65 @@
*/

#include <aws/backup-gateway/BackupGatewayErrors.h>
#include <aws/backup-gateway/model/AccessDeniedException.h>
#include <aws/backup-gateway/model/ConflictException.h>
#include <aws/backup-gateway/model/InternalServerException.h>
#include <aws/backup-gateway/model/ResourceNotFoundException.h>
#include <aws/backup-gateway/model/ThrottlingException.h>
#include <aws/backup-gateway/model/ValidationException.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/cbor/CborValue.h>

using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::BackupGateway;
using namespace Aws::BackupGateway::Model;

namespace Aws {
namespace BackupGateway {
template <>
AWS_BACKUPGATEWAY_API ConflictException BackupGatewayError::GetModeledError() {
assert(this->GetErrorType() == BackupGatewayErrors::CONFLICT);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ConflictException(payload.GetDecoder());
}

template <>
AWS_BACKUPGATEWAY_API ThrottlingException BackupGatewayError::GetModeledError() {
assert(this->GetErrorType() == BackupGatewayErrors::THROTTLING);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ThrottlingException(payload.GetDecoder());
}

template <>
AWS_BACKUPGATEWAY_API InternalServerException BackupGatewayError::GetModeledError() {
assert(this->GetErrorType() == BackupGatewayErrors::INTERNAL_SERVER);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return InternalServerException(payload.GetDecoder());
}

template <>
AWS_BACKUPGATEWAY_API ResourceNotFoundException BackupGatewayError::GetModeledError() {
assert(this->GetErrorType() == BackupGatewayErrors::RESOURCE_NOT_FOUND);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ResourceNotFoundException(payload.GetDecoder());
}

template <>
AWS_BACKUPGATEWAY_API ValidationException BackupGatewayError::GetModeledError() {
assert(this->GetErrorType() == BackupGatewayErrors::VALIDATION);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ValidationException(payload.GetDecoder());
}

template <>
AWS_BACKUPGATEWAY_API AccessDeniedException BackupGatewayError::GetModeledError() {
assert(this->GetErrorType() == BackupGatewayErrors::ACCESS_DENIED);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return AccessDeniedException(payload.GetDecoder());
}

namespace BackupGatewayErrorMapper {

static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,57 @@
*/

#include <aws/cloudwatchomni/CloudWatchOmniErrors.h>
#include <aws/cloudwatchomni/model/ConflictException.h>
#include <aws/cloudwatchomni/model/InternalServerException.h>
#include <aws/cloudwatchomni/model/ResourceNotFoundException.h>
#include <aws/cloudwatchomni/model/ThrottlingException.h>
#include <aws/cloudwatchomni/model/ValidationException.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/cbor/CborValue.h>

using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::CloudWatchOmni;
using namespace Aws::CloudWatchOmni::Model;

namespace Aws {
namespace CloudWatchOmni {
template <>
AWS_CLOUDWATCHOMNI_API ConflictException CloudWatchOmniError::GetModeledError() {
assert(this->GetErrorType() == CloudWatchOmniErrors::CONFLICT);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ConflictException(payload.GetDecoder());
}

template <>
AWS_CLOUDWATCHOMNI_API ThrottlingException CloudWatchOmniError::GetModeledError() {
assert(this->GetErrorType() == CloudWatchOmniErrors::THROTTLING);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ThrottlingException(payload.GetDecoder());
}

template <>
AWS_CLOUDWATCHOMNI_API ResourceNotFoundException CloudWatchOmniError::GetModeledError() {
assert(this->GetErrorType() == CloudWatchOmniErrors::RESOURCE_NOT_FOUND);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ResourceNotFoundException(payload.GetDecoder());
}

template <>
AWS_CLOUDWATCHOMNI_API InternalServerException CloudWatchOmniError::GetModeledError() {
assert(this->GetErrorType() == CloudWatchOmniErrors::INTERNAL_SERVER);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return InternalServerException(payload.GetDecoder());
}

template <>
AWS_CLOUDWATCHOMNI_API ValidationException CloudWatchOmniError::GetModeledError() {
assert(this->GetErrorType() == CloudWatchOmniErrors::VALIDATION);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return ValidationException(payload.GetDecoder());
}

namespace CloudWatchOmniErrorMapper {

static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException");
Expand Down
10 changes: 10 additions & 0 deletions generated/src/aws-cpp-sdk-comprehend/source/ComprehendErrors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@
*/

#include <aws/comprehend/ComprehendErrors.h>
#include <aws/comprehend/model/InvalidRequestException.h>
#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/cbor/CborValue.h>

using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::Comprehend;
using namespace Aws::Comprehend::Model;

namespace Aws {
namespace Comprehend {
template <>
AWS_COMPREHEND_API InvalidRequestException ComprehendError::GetModeledError() {
assert(this->GetErrorType() == ComprehendErrors::INVALID_REQUEST);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return InvalidRequestException(payload.GetDecoder());
}

namespace ComprehendErrorMapper {

static const int UNSUPPORTED_LANGUAGE_HASH = HashingUtils::HashString("UnsupportedLanguageException");
Expand Down
18 changes: 18 additions & 0 deletions generated/src/aws-cpp-sdk-datasync/source/DataSyncErrors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,32 @@

#include <aws/core/client/AWSError.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/utils/cbor/CborValue.h>
#include <aws/datasync/DataSyncErrors.h>
#include <aws/datasync/model/InternalException.h>
#include <aws/datasync/model/InvalidRequestException.h>

using namespace Aws::Client;
using namespace Aws::Utils;
using namespace Aws::DataSync;
using namespace Aws::DataSync::Model;

namespace Aws {
namespace DataSync {
template <>
AWS_DATASYNC_API InternalException DataSyncError::GetModeledError() {
assert(this->GetErrorType() == DataSyncErrors::INTERNAL);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return InternalException(payload.GetDecoder());
}

template <>
AWS_DATASYNC_API InvalidRequestException DataSyncError::GetModeledError() {
assert(this->GetErrorType() == DataSyncErrors::INVALID_REQUEST);
Aws::Utils::Cbor::CborValue payload(this->GetCborPayload());
return InvalidRequestException(payload.GetDecoder());
}

namespace DataSyncErrorMapper {

static const int INTERNAL_HASH = HashingUtils::HashString("InternalException");
Expand Down
Loading
Loading