Skip to content

Commit e32b707

Browse files
committed
Improves error messages
1 parent c6f969b commit e32b707

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/commands/createPullRequestOnRemote.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class CreatePullRequestOnRemoteCommand extends GlCommandBase {
3838
const branch = await repo.git.branches().getBranch();
3939
if (branch?.upstream == null) {
4040
void window.showErrorMessage(
41-
`Unable to create a pull request for branch \`${branch?.name}\` because it has no upstream branch`,
41+
`Unable to create a pull request for branch \`${branch?.name}\` as it hasn't been published to a remote.`,
4242
);
4343
return;
4444
}
@@ -52,7 +52,12 @@ export class CreatePullRequestOnRemoteCommand extends GlCommandBase {
5252
}
5353

5454
const compareRemote = await repo.git.remotes().getRemote(args.remote);
55-
if (compareRemote?.provider == null) return;
55+
if (compareRemote?.provider == null) {
56+
void window.showErrorMessage(
57+
`Unable to create a pull request for branch \`${args.compare}\` because it is not associated with a supported remote provider.`,
58+
);
59+
return;
60+
}
5661

5762
const providerId = compareRemote.provider.id;
5863
const remotes = (await repo.git.remotes().getRemotes({

0 commit comments

Comments
 (0)