Skip to content
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

fix: no help/issue link #1065

Merged
merged 1 commit into from
May 17, 2021
Merged
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
6 changes: 3 additions & 3 deletions packages/vscode-extension/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,13 +819,13 @@ export function cmdHdlDisposeTreeView() {
TreeViewManagerInstance.dispose();
}

export async function showError(e: FxError) {
export async function showError(e: UserError | SystemError) {
VsCodeLogInstance.error(`code:${e.source}.${e.name}, message: ${e.message}, stack: ${e.stack}`);

const errorCode = `${e.source}.${e.name}`;
if (isUserCancelError(e)) {
return;
} else if (e instanceof UserError && e.helpLink && typeof e.helpLink != "undefined") {
} else if ("helpLink" in e && e.helpLink && typeof e.helpLink != "undefined") {
const help = {
title: StringResources.vsc.handlers.getHelp,
run: async (): Promise<void> => {
Expand All @@ -835,7 +835,7 @@ export async function showError(e: FxError) {

const button = await window.showErrorMessage(`[${errorCode}]: ${e.message}`, help);
if (button) await button.run();
} else if (e instanceof SystemError && e.issueLink && typeof e.issueLink != "undefined") {
} else if ("issueLink" in e && e.issueLink && typeof e.issueLink != "undefined") {
const path = e.issueLink.replace(/\/$/, "") + "?";
const param = `title=new+bug+report: ${errorCode}&body=${e.message}\n\n${e.stack}`;
const issue = {
Expand Down