Skip to content

Commit

Permalink
Add details of error to the "Unexpected git error!" message
Browse files Browse the repository at this point in the history
  • Loading branch information
greysteil committed Sep 10, 2019
1 parent 11c25c7 commit d27aa5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion common/lib/dependabot/pull_request_creator/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def branch_exists?(name)
raise(RepoNotFound, source.url) unless repo_exists?

retrying ||= false
raise "Unexpected git error!" if retrying

msg = "Unexpected git error!\n\n#{e.cause&.class}: #{e.cause&.message}"
raise msg if retrying

retrying = true
retry
Expand Down
2 changes: 1 addition & 1 deletion common/spec/dependabot/pull_request_creator/github_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
end

it "raises a normal error" do
expect { creator.create }.to raise_error("Unexpected git error!")
expect { creator.create }.to raise_error(/Unexpected git error!/)
end
end

Expand Down

0 comments on commit d27aa5b

Please sign in to comment.