Skip to content

Commit

Permalink
report extra information if a repo can't be found
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfo authored and JamieMagee committed Oct 19, 2023
1 parent 9a8a26f commit 155566a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/lib/dependabot/file_fetchers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def clone_repo_contents
raise Dependabot::OutOfDisk
end

raise Dependabot::RepoNotFound, source
raise Dependabot::RepoNotFound.new(source, e.message)
end

def ecosystem_versions
Expand Down
4 changes: 2 additions & 2 deletions updater/lib/dependabot/file_fetcher_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def perform_job
Dependabot.logger.error("Repository is rate limited, attempting to retry in " \
"#{remaining}s")
else
Dependabot.logger.error("Error during file fetching; aborting")
Dependabot.logger.error("Error during file fetching; aborting: #{e.message}")
end
handle_file_fetcher_error(e)
service.mark_job_as_processed(@base_commit_sha)
Expand Down Expand Up @@ -144,7 +144,7 @@ def handle_file_fetcher_error(error)
# This also happens when a configured personal access token is not authz'd to fetch files from the job repo.
{
"error-type": "job_repo_not_found",
"error-detail": {}
"error-detail": { message: error.message }
}
when Dependabot::DependencyFileNotParseable
{
Expand Down
2 changes: 1 addition & 1 deletion updater/spec/dependabot/file_fetcher_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
expect(api_client)
.to receive(:record_update_job_error)
.with(
error_details: {},
error_details: { message: "Dependabot::RepoNotFound" },
error_type: "job_repo_not_found"
)
expect(api_client).to receive(:mark_job_as_processed)
Expand Down

0 comments on commit 155566a

Please sign in to comment.