Skip to content

[server] Improve error message when trying to open a PR with deleted branch #3869

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

Merged
merged 2 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion components/dashboard/src/start/StartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ function StartError(props: { error: StartWorkspaceError }) {
if (!error) {
return null;
}
return <p className="text-base text-gitpod-red">{error.message}</p>;
return <p className="text-base text-gitpod-red w-96">{error.message}</p>;
Copy link
Contributor

@gtsiolis gtsiolis Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Go w-96! 🔮

}
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