martinzink commented on code in PR #1926:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1926#discussion_r2000998260


##########
libminifi/src/core/flow/StructuredConfiguration.cpp:
##########
@@ -789,114 +785,88 @@ void 
StructuredConfiguration::parsePropertyValueSequence(const std::string& prop
 
       logger_->log_debug("Found property {}", property_name);
 
-      if (!component.updateProperty(property_name, rawValueString)) {
-        auto proc = dynamic_cast<core::Connectable*>(&component);
-        if (proc) {
-          logger_->log_warn("Received property {} with value {} but is not one 
of the properties for {}. Attempting to add as dynamic property.", 
property_name, rawValueString, proc->getName());
-          if (!component.updateDynamicProperty(property_name, rawValueString)) 
{
-            logger_->log_warn("Unable to set the dynamic property {}", 
property_name);
-          } else {
-            logger_->log_warn("Dynamic property {} has been set", 
property_name);
-          }
+      const auto append_prop_result = component.appendProperty(property_name, 
rawValueString);
+      if (!append_prop_result && append_prop_result.error() == 
make_error_code(PropertyErrorCode::NotSupportedProperty)) {
+        logger_->log_warn("Received property {} with value {} but is not one 
of the properties for {}. Attempting to add as dynamic property.", 
property_name, rawValueString, component.getName());

Review Comment:
   Yeah, I think its better to throw
   
https://github.com/apache/nifi-minifi-cpp/pull/1926/commits/c7c7a6bf31a417664b894a4031ba26bdf5ab3245



-- 
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]

Reply via email to