Skip to content

Commit 36cee4b

Browse files
authored
Added missing HttpRequestContentErrorInfo in RWSClient::httpPut() and RWSClient::httpPost() (ros-industrial#60)
1 parent 7c36539 commit 36cee4b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/v1_0/rws_client.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ std::optional<int> tryParseRetcode(std::string const& content) noexcept
264264
std::string code_str = xmlFindTextContent(xml, XMLAttribute{"class", "code"});
265265
if (!code_str.empty())
266266
result = std::stoi(code_str);
267-
}
267+
}
268268
catch (Poco::XML::XMLException const&) {}
269269
catch (std::invalid_argument const&) {}
270270
catch (std::out_of_range const&) {}
@@ -303,6 +303,7 @@ POCOResult RWSClient::httpPost(const std::string& uri, const std::string& conten
303303
auto exception = ProtocolError {"HTTP response status not accepted"}
304304
<< HttpMethodErrorInfo {"POST"}
305305
<< UriErrorInfo {uri}
306+
<< HttpRequestContentErrorInfo {content}
306307
<< HttpStatusErrorInfo {result.httpStatus()}
307308
<< HttpResponseContentErrorInfo {result.content()}
308309
<< HttpReasonErrorInfo {result.reason()};
@@ -324,6 +325,7 @@ POCOResult RWSClient::httpPut(const std::string& uri, const std::string& content
324325
auto exception = ProtocolError {"HTTP response status not accepted"}
325326
<< HttpMethodErrorInfo {"PUT"}
326327
<< UriErrorInfo {uri}
328+
<< HttpRequestContentErrorInfo {content}
327329
<< HttpStatusErrorInfo {result.httpStatus()}
328330
<< HttpResponseContentErrorInfo {result.content()}
329331
<< HttpReasonErrorInfo {result.reason()};

src/v2_0/rws_client.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ std::optional<int> tryParseRetcode(std::string const& content) noexcept
315315
std::string code_str = xmlFindTextContent(xml, XMLAttribute{"class", "code"});
316316
if (!code_str.empty())
317317
result = std::stoi(code_str);
318-
}
318+
}
319319
catch (Poco::XML::XMLException const&) {}
320320
catch (std::invalid_argument const&) {}
321321
catch (std::out_of_range const&) {}
@@ -369,6 +369,7 @@ POCOResult RWSClient::httpPost(const std::string& uri, const std::string& conten
369369
auto exception = ProtocolError {"HTTP response status not accepted"}
370370
<< HttpMethodErrorInfo {"POST"}
371371
<< UriErrorInfo {uri}
372+
<< HttpRequestContentErrorInfo {content}
372373
<< HttpStatusErrorInfo {result.httpStatus()}
373374
<< HttpResponseContentErrorInfo {result.content()}
374375
<< HttpReasonErrorInfo {result.reason()};
@@ -397,6 +398,7 @@ POCOResult RWSClient::httpPut(const std::string& uri, const std::string& content
397398
auto exception = ProtocolError {"HTTP response status not accepted"}
398399
<< HttpMethodErrorInfo {"PUT"}
399400
<< UriErrorInfo {uri}
401+
<< HttpRequestContentErrorInfo {content}
400402
<< HttpStatusErrorInfo {result.httpStatus()}
401403
<< HttpResponseContentErrorInfo {result.content()}
402404
<< HttpReasonErrorInfo {result.reason()};

0 commit comments

Comments
 (0)