Skip to content

Commit 1080566

Browse files
committed
Fix self cert tests
1 parent 2aabfae commit 1080566

File tree

6 files changed

+396
-393
lines changed

6 files changed

+396
-393
lines changed

news/3 Code Health/10447.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable the `Selft Cert` tests for Notebooks.

src/client/common/errors/errorUtils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
import { EOL } from 'os';
5+
46
// tslint:disable-next-line:no-stateless-class no-unnecessary-class
57
export class ErrorUtils {
68
public static outputHasModuleNotInstalledError(moduleName: string, content?: string): boolean {
@@ -11,3 +13,15 @@ export class ErrorUtils {
1113
: false;
1214
}
1315
}
16+
17+
/**
18+
* Wraps an error with a custom error message, retaining the call stack information.
19+
*/
20+
export class WrappedError extends Error {
21+
constructor(message: string, originalException: Error) {
22+
super(message);
23+
// Retain call stack that trapped the error and rethrows this error.
24+
// Also retain the call stack of the original error.
25+
this.stack = `${new Error('').stack}${EOL}${EOL}${originalException.stack}`;
26+
}
27+
}

0 commit comments

Comments
 (0)