Add new errorCode property to notebook errors to see if starting a notebook session failed. (#18617)

This commit is contained in:
Cory Rivera
2022-03-03 14:05:54 -08:00
committed by GitHub
parent 10ff8aa116
commit 0ab4752643
4 changed files with 9 additions and 5 deletions

View File

@@ -104,12 +104,14 @@ export function transformErrorForSerialization(error: any): any;
export function transformErrorForSerialization(error: any): any {
if (error instanceof Error) {
let { name, message } = error;
let errorCode = (<any>error).errorCode; // {{SQL CARBON EDIT}} Add error code to retain more information
const stack: string = (<any>error).stacktrace || (<any>error).stack;
return {
$isError: true,
name,
message,
stack
stack,
errorCode
};
}

View File

@@ -445,6 +445,7 @@ export class RPCProtocol extends Disposable implements IRPCProtocol {
err.name = value.name;
err.message = value.message;
err.stack = value.stack;
err.errorCode = value.errorCode; // {{SQL CARBON EDIT}} Include custom error code
} else {
err = value;
}