From c014522301abe5daf86afbffb339d17b76354037 Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Fri, 9 Apr 2021 12:50:10 +0000 Subject: [PATCH 1/2] [server] Improve error message when trying to open a PR with deleted branch Fixes #4 #321 #802 #1375 #3659 gitpod-com/gitpod#1722 gitpod-com/gitpod#2244 --- components/server/src/github/github-context-parser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/server/src/github/github-context-parser.ts b/components/server/src/github/github-context-parser.ts index d147ef82a550c2..daebef9bccc1a7 100644 --- a/components/server/src/github/github-context-parser.ts +++ b/components/server/src/github/github-context-parser.ts @@ -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 { title: pr.title, repository: this.toRepository(host, pr.headRef.repository), From 2791d3a9bf9a2dd3def646ee53eb65c8ee9f2bbf Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Fri, 9 Apr 2021 13:13:53 +0000 Subject: [PATCH 2/2] [dashboard] Show workspace start errors in futuristic width --- components/dashboard/src/start/StartPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dashboard/src/start/StartPage.tsx b/components/dashboard/src/start/StartPage.tsx index 6c0bb476b1a346..3f5bde5fa02b9d 100644 --- a/components/dashboard/src/start/StartPage.tsx +++ b/components/dashboard/src/start/StartPage.tsx @@ -96,5 +96,5 @@ function StartError(props: { error: StartWorkspaceError }) { if (!error) { return null; } - return

{error.message}

; + return

{error.message}

; }