Skip to content

Re-enable self cert tests for notebooks #11197

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

Merged
merged 1 commit into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions news/3 Code Health/10447.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable the `Selft Cert` tests for Notebooks.
14 changes: 14 additions & 0 deletions src/client/common/errors/errorUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { EOL } from 'os';

// tslint:disable-next-line:no-stateless-class no-unnecessary-class
export class ErrorUtils {
public static outputHasModuleNotInstalledError(moduleName: string, content?: string): boolean {
Expand All @@ -11,3 +13,15 @@ export class ErrorUtils {
: false;
}
}

/**
* Wraps an error with a custom error message, retaining the call stack information.
*/
export class WrappedError extends Error {
constructor(message: string, originalException: Error) {
super(message);
// Retain call stack that trapped the error and rethrows this error.
// Also retain the call stack of the original error.
this.stack = `${new Error('').stack}${EOL}${EOL}${originalException.stack}`;
}
}
Loading