adamdebreceni commented on a change in pull request #917:
URL: https://github.com/apache/nifi-minifi-cpp/pull/917#discussion_r503770153
##########
File path: extensions/libarchive/CompressContent.cpp
##########
@@ -81,39 +101,42 @@ void CompressContent::initialize() {
}
void CompressContent::onSchedule(core::ProcessContext *context,
core::ProcessSessionFactory *sessionFactory) {
- std::string value;
context->getProperty(CompressLevel.getName(), compressLevel_);
context->getProperty(CompressMode.getName(), compressMode_);
- context->getProperty(CompressFormat.getName(), compressFormat_);
+
+ {
+ std::string compressFormatStr;
+ context->getProperty(CompressFormat.getName(), compressFormatStr);
+ std::transform(compressFormatStr.begin(), compressFormatStr.end(),
compressFormatStr.begin(), ::tolower);
+ compressFormat_ =
ExtendedCompressionFormat::parse(compressFormatStr.c_str());
+ if (!compressFormat_) {
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Unknown compression format:
\"" + compressFormatStr + "\"");
+ }
+ }
Review comment:
done, moved the checking into the extraction (getProperty) itself
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]