Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve snakeyaml error message #400

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
zachgk committed Dec 13, 2022
commit fa2a3ff21a2679fe8d4ff3765dc0e09c27b49b53
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