martinzink commented on code in PR #2148:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2148#discussion_r3008230708
##########
extensions/bustache/ApplyTemplate.cpp:
##########
@@ -61,8 +61,11 @@ void ApplyTemplate::onTrigger(core::ProcessContext& context,
core::ProcessSessio
// TODO(calebj) write ostream reciever for format() to prevent excessive
copying
std::string ostring = bustache::to_string(format(data));
- output_stream->write(gsl::make_span(ostring).as_span<const std::byte>());
- return gsl::narrow<int64_t>(ostring.length());
+ const auto write_res =
output_stream->write(gsl::make_span(ostring).as_span<const std::byte>());
+ if (write_res < 0) {
+ return io::IoResult::error();
+ }
+ return io::IoResult::fromSizeT(ostring.length());
Review Comment:
good point fixed,
https://github.com/apache/nifi-minifi-cpp/pull/2148/changes/d0cc52597cee192b10d9f46d08340029f6a8c6d5#diff-920237a9f4b39ba595639dc10b0b316826c369990c09d6bc41a8fa24fc6d2ce5R64-R66
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]