martinweiler commented on code in PR #7259:
URL: https://github.com/apache/incubator-kie/pull/7259#discussion_r4528156369


##########
kogito-jbpm/jbpm-flow-migration/src/main/java/org/jbpm/flow/migration/impl/JsonMigrationPlanFileReader.java:
##########
@@ -49,9 +50,14 @@ public MigrationPlan read(InputStream is) throws IOException 
{
 
             MigrationPlan migrationPlan = objectMapper.readValue(is, 
MigrationPlan.class);
             LOGGER.trace("Read migration plan {} in json format", 
migrationPlan);
+            if (migrationPlan.getProcessMigrationPlan() != null) {
+                
migrationPlan.getProcessMigrationPlan().getVariableMigrationPlan().forEach(VariableMigrationPlan::validate);
+            }
             return migrationPlan;
         } catch (IOException e) {
             throw new MigrationPlanFileFormatException("Error during 
marshalling", e);
+        } catch (IllegalArgumentException e) {
+            throw new MigrationPlanFileFormatException("Invalid variable 
migration plan: " + e.getMessage());

Review Comment:
   It would be good to include the cause here (`e`) here as well, so that the 
exact failure location is contained in the logs and stacktraces.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to