diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2018-07-13 05:08:45 +0200 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2018-07-13 05:08:45 +0200 |
commit | 9265e7692033c8a38ade4e31281613e3fb299611 (patch) | |
tree | aa79cfc4451f71f06415d33c08c01054199ea7bc /danger | |
parent | 924146a8d6b158fda1f9cddbdcd8ce957b6baec9 (diff) | |
download | gitlab-ce-9265e7692033c8a38ade4e31281613e3fb299611.tar.gz |
Use the correct exceptions to look for invalid YAML in Changelogsfix-danger
Diffstat (limited to 'danger')
-rw-r--r-- | danger/changelog/Dangerfile | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/danger/changelog/Dangerfile b/danger/changelog/Dangerfile index 2424e650d07..0374de24520 100644 --- a/danger/changelog/Dangerfile +++ b/danger/changelog/Dangerfile @@ -38,12 +38,14 @@ def check_changelog(path) if yaml["merge_request"].nil? message "Consider setting `merge_request` to #{gitlab.mr_json["iid"]} in #{gitlab.html_link(path)}. #{SEE_DOC}" - elsif yaml["merge_request"] != gitlab.mr_json["iid"] && !ce_port_changelog?(changelog_path) + elsif yaml["merge_request"] != gitlab.mr_json["iid"] && !ce_port_changelog?(path) fail "Merge request ID was not set to #{gitlab.mr_json["iid"]}! #{SEE_DOC}" end -rescue StandardError +rescue Psych::SyntaxError, Psych::DisallowedClass, Psych::BadAlias # YAML could not be parsed, fail the build. fail "#{gitlab.html_link(path)} isn't valid YAML! #{SEE_DOC}" +rescue StandardError => e + warn "There was a problem trying to check the Changelog. Exception: #{e.name} - #{e.message}" end def presented_no_changelog_labels |