Skip to content

Commit

Permalink
Merge pull request #1152 from CloudSlang/720305_fixed_error_message
Browse files Browse the repository at this point in the history
Set default jython true
  • Loading branch information
iancuapahidean committed Feb 7, 2020
2 parents 57297ad + de4c49a commit 4122c06
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void bindInput(Input input, Map<String, ? extends Value> context, Map<St
try {
value = resolveValue(input, context, targetContext, systemProperties);
} catch (Throwable t) {
throw new RuntimeException(errorMessagePrefix + "', \n\tError is: " + t.getMessage(), t);
throw new RuntimeException(errorMessagePrefix + "', \n\t" + t.getMessage(), t);
}

if (input.isRequired() && isEmpty(value)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Map<String, Value> bindOutputs(
if (possibleOutputs != null) {
for (Output output : possibleOutputs) {
String outputKey = output.getName();
String errorMessagePrefix = "Error binding output: '" + output.getName();
String errorMessagePrefix = "Binding output: '" + output.getName() + " failed";
Value rawValue = output.getValue();
Value valueToAssign = rawValue;
String expressionToEvaluate = extractExpression(rawValue == null ? null : rawValue.get());
Expand All @@ -62,7 +62,7 @@ public Map<String, Value> bindOutputs(
systemProperties, output.getFunctionDependencies());
valueToAssign = ValueFactory.create(value, rawValue != null && rawValue.isSensitive());
} catch (Throwable t) {
throw new RuntimeException(errorMessagePrefix + "',\n\tError is: " + t.getMessage(), t);
throw new RuntimeException(errorMessagePrefix + "',\n\t" + t.getMessage(), t);
}
}
validateStringValue(errorMessagePrefix, valueToAssign);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public Value evalExpr(String expr, Map<String, Value> context, Set<SystemPropert
functionDependencies);
}
} catch (Exception exception) {
throw new RuntimeException("Error in running script expression: '" +
getTruncatedExpression(expr) + "',\n\tException is: " +
throw new RuntimeException("Error in evaluating expression: '" +
getTruncatedExpression(expr) + "',\n\t" +
handleExceptionSpecialCases(exception.getMessage()), exception);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public void describeTo(Description description) {
public boolean matches(Object o) {
String message = o.toString();
return message.contains("Error binding input: 'input1'") &&
message.contains("Error is: Error in running script expression: 'input1'") &&
message.contains("Exception is: name 'input1' is not defined");
message.contains("Error in evaluating expression: 'input1'") &&
message.contains("name 'input1' is not defined");
}
});
bindInputs(inputs);
Expand All @@ -171,8 +171,8 @@ public void describeTo(Description description) {
public boolean matches(Object o) {
String message = o.toString();
return message.contains("Error binding input: 'input1'") &&
message.contains("Error is: Error in running script expression: 'input1'") &&
message.contains("Exception is: name 'input1' is not defined");
message.contains("Error in evaluating expression: 'input1'") &&
message.contains("name 'input1' is not defined");
}
});
bindInputs(inputs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public boolean matches(Object o) {
String message = o.toString();
return message.contains("Error running: 'check_weather_missing_input'") &&
message.contains("Error binding input: 'input_get_missing_input'") &&
message.contains("Error is: Error in running script expression: 'missing_input'") &&
message.contains("Exception is: name 'missing_input' is not defined");
message.contains("Error in evaluating expression: 'missing_input'") &&
message.contains("name 'missing_input' is not defined");
}
});
triggerWithData(compilationArtifact, userInputs, systemProperties);
Expand Down

0 comments on commit 4122c06

Please sign in to comment.