Skip to content

Commit

Permalink
Improve snakeyaml error message (#400)
Browse files Browse the repository at this point in the history
* Improve snakeyaml error message

This provides a better error message for the requirements to parse yaml files
that clearly indicate what to change in order to support it.

* Format
  • Loading branch information
zachgk authored Dec 14, 2022
1 parent 47a31d8 commit f23572e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ public static WorkflowDefinition parse(URI uri, Reader input) {
String asJson = GSON.toJson(yaml);
return GSON.fromJson(asJson, WorkflowDefinition.class);
} catch (ReflectiveOperationException e) {
throw new IllegalArgumentException("Yaml parsing is not supported.", e);
throw new IllegalArgumentException(
"Yaml parsing is not supported. In order to support parsing Yaml files, the"
+ " dependency snakeyaml is required. Please add"
+ " 'org.yaml.snakeyaml.Yaml' to your classpath, pom.xml, or"
+ " build.gradle.",
e);
}
} else if (fileName.endsWith(".json")) {
return GSON.fromJson(input, WorkflowDefinition.class);
Expand Down

0 comments on commit f23572e

Please sign in to comment.