Skip to content

Commit

Permalink
Merge pull request #148 from camunda/145-gracefully-handle-variable-m…
Browse files Browse the repository at this point in the history
…apping

test(runtime-util): increase test coverage for handler
  • Loading branch information
tmetzke authored Nov 10, 2022
2 parents e0c2e41 + afa139e commit a3674c4
Show file tree
Hide file tree
Showing 3 changed files with 386 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ConnectorHelper {
// TODO: Check if this is properly configured
public static ObjectMapper OBJECT_MAPPER = new ObjectMapper();

private static final String ERROR_CANNOT_PARSE_VARIABLES = "Cannot parse variables";
private static final String ERROR_CANNOT_PARSE_VARIABLES = "Cannot parse '%s' as '%s'.";

public static final String RESULT_VARIABLE_HEADER_NAME = "resultVariable";
public static final String RESULT_EXPRESSION_HEADER_NAME = "resultExpression";
Expand Down Expand Up @@ -77,7 +77,11 @@ private static <T> T parseJsonVarsAsTypeOrThrow(
try {
return OBJECT_MAPPER.readValue(jsonVars, type);
} catch (JsonProcessingException e) {
throw new FeelEngineWrapperException(ERROR_CANNOT_PARSE_VARIABLES, expression, jsonVars, e);
throw new FeelEngineWrapperException(
String.format(ERROR_CANNOT_PARSE_VARIABLES, jsonVars, type.getName()),
expression,
jsonVars,
e);
}
}
}
Loading

0 comments on commit a3674c4

Please sign in to comment.