Skip to content

Commit 3849265

Browse files
committed
Update WrapError to make report clear
1 parent e6dc29f commit 3849265

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/common/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,11 @@ export function getServiceURL(gitpodHost: string): string {
213213
export class WrapError extends Error {
214214
code: string | undefined;
215215
constructor(msg: string, err: any, code?: string) {
216-
super(msg);
217-
if (err instanceof Error) {
216+
const isErr = err instanceof Error;
217+
super(isErr ? `${msg}: ${err.message}` : msg);
218+
if (isErr) {
218219
this.name = err.name;
219-
this.stack = err.stack;
220-
this.message = `${msg}: ${err.message}`;
220+
this.stack = this.stack + '\n\n' + err.stack;
221221
}
222222
this.code = code ? code : err.code;
223223
}

0 commit comments

Comments
 (0)