Skip to content

Commit

Permalink
chore:update QiankunError
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmhandsome committed Oct 30, 2023
1 parent 7429bc9 commit 207308e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/shared/src/error/QiankunError.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
export class QiankunError extends Error {
constructor(message: string) {
super(`[qiankun]: ${message}`);
}
}

export class QiankunError2 extends Error {
constructor(code: number, message: string, ...args: string[]) {
super(`[qiankun #${code}]: ${message ? message + " " : ""}See https://qiankun.umijs.org/error/?code=${code}${args.length ? `&arg=${args.join("&arg=")}` : ""
}`);
let errorMessage = `[qiankun #${code}]: ${message ? message + ' ' : ''}`;
if (process.env.NODE_ENV === 'production') {
errorMessage += `See https://qiankun.umijs.org/error/?code=${code}${
args.length ? `&arg=${args.join('&arg=')}` : ''
}`;
} else {
console.warn('args', ...args)
}
super(errorMessage);
}
}

0 comments on commit 207308e

Please # to comment.