Skip to content

Commit

Permalink
[server] Improve error message when trying to open a PR with deleted …
Browse files Browse the repository at this point in the history
…branch

Fixes #4 #321 #802 #1375 #3659 gitpod-com/gitpod#1722 gitpod-com/gitpod#2244
  • Loading branch information
jankeromnes committed Apr 12, 2021
1 parent a5f19d2 commit c014522
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/server/src/github/github-context-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,12 @@ export class GithubContextParser extends AbstractContextParser implements IConte
if (tryIssueContext) {
return this.handleIssueContext({span}, user, host, owner, repoName, pullRequestNr, false);
} else {
throw new Error(`Couldn't find issue or pull request #${pullRequestNr} in repository ${owner}/${repoName}.`)
throw new Error(`Could not find issue or pull request #${pullRequestNr} in repository ${owner}/${repoName}.`)
}
}
if (pr.headRef === null) {
throw new Error(`Could not open pull request ${owner}/${repoName}#${pullRequestNr}. Source branch may have been removed.`);
}
return <PullRequestContext>{
title: pr.title,
repository: this.toRepository(host, pr.headRef.repository),
Expand Down

0 comments on commit c014522

Please sign in to comment.