Skip to content

Commit b58e38a

Browse files
committed
Add RpcV2ErrorMarshaller tests
1 parent f046028 commit b58e38a

File tree

3 files changed

+634
-6
lines changed

3 files changed

+634
-6
lines changed

src/aws-cpp-sdk-core/source/client/AWSErrorMarshaller.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ AWSError<CoreErrors> RpcV2ErrorMarshaller::Marshall(const Aws::Http::HttpRespons
497497
error = AWSError<CoreErrors>(CoreErrors::UNKNOWN, "", "Failed to parse CBOR error payload", isRetryable);
498498
}
499499

500+
MarshallError(error, httpResponse);
501+
500502
error.SetRequestId(httpResponse.HasHeader(REQUEST_ID_HEADER) ? httpResponse.GetHeader(REQUEST_ID_HEADER) : "");
501503
return error;
502504
}

src/aws-cpp-sdk-core/source/utils/cbor/CborValue.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
using namespace Aws::Utils::Cbor;
99
using namespace Aws::Crt::Cbor;
1010

11+
static const char AWS_CBOR_VALUE_LOG_TAG[] = "CborValue";
12+
1113
CborValue::CborValue() : m_decoder(nullptr)
1214
{
1315
}
@@ -18,29 +20,29 @@ CborValue::CborValue(Aws::IStream& istream) : m_decoder(nullptr)
1820
ss << istream.rdbuf();
1921
m_body = ss.str();
2022
auto cursor = Aws::Crt::ByteCursorFromArray(reinterpret_cast<const uint8_t*>(m_body.c_str()), m_body.length());
21-
m_decoder = std::make_shared<CborDecoder>(cursor);
23+
m_decoder = Aws::MakeShared<CborDecoder>(AWS_CBOR_VALUE_LOG_TAG, cursor);
2224
}
2325

2426
CborValue::CborValue(const Aws::String& value) : m_decoder(nullptr)
2527
{
2628
m_body = value;
2729
auto cursor = Aws::Crt::ByteCursorFromArray(reinterpret_cast<const uint8_t*>(m_body.c_str()), m_body.length());
28-
m_decoder = std::make_shared<CborDecoder>(cursor);
30+
m_decoder = Aws::MakeShared<CborDecoder>(AWS_CBOR_VALUE_LOG_TAG, cursor);
2931
}
3032

3133
CborValue::CborValue(const CborValue& other) :
3234
m_body(other.m_body)
3335
{
3436
auto cursor = Aws::Crt::ByteCursorFromArray(reinterpret_cast<const uint8_t*>(m_body.c_str()), m_body.length());
35-
m_decoder = std::make_shared<CborDecoder>(cursor);
37+
m_decoder = Aws::MakeShared<CborDecoder>(AWS_CBOR_VALUE_LOG_TAG, cursor);
3638
}
3739

3840
CborValue& CborValue::operator=(const CborValue& other)
3941
{
4042
if (this != &other) {
4143
m_body = other.m_body;
4244
auto cursor = Aws::Crt::ByteCursorFromArray(reinterpret_cast<const uint8_t*>(m_body.c_str()), m_body.length());
43-
m_decoder = std::make_shared<CborDecoder>(cursor);
45+
m_decoder = Aws::MakeShared<CborDecoder>(AWS_CBOR_VALUE_LOG_TAG, cursor);
4446
}
4547
return *this;
4648
}
@@ -49,15 +51,15 @@ CborValue::CborValue(CborValue&& value) noexcept :
4951
m_body(std::move(value.m_body))
5052
{
5153
auto cursor = Aws::Crt::ByteCursorFromArray(reinterpret_cast<const uint8_t*>(m_body.c_str()), m_body.length());
52-
m_decoder = std::make_shared<CborDecoder>(cursor);
54+
m_decoder = Aws::MakeShared<CborDecoder>(AWS_CBOR_VALUE_LOG_TAG, cursor);
5355
}
5456

5557
CborValue& CborValue::operator=(CborValue&& other) noexcept
5658
{
5759
if (this != &other) {
5860
m_body = std::move(other.m_body);
5961
auto cursor = Aws::Crt::ByteCursorFromArray(reinterpret_cast<const uint8_t*>(m_body.c_str()), m_body.length());
60-
m_decoder = std::make_shared<CborDecoder>(cursor);
62+
m_decoder = Aws::MakeShared<CborDecoder>(AWS_CBOR_VALUE_LOG_TAG, cursor);
6163
}
6264
return *this;
6365
}

0 commit comments

Comments
 (0)