* Fixed #5210

* Added function to check error to ensure get string
This commit is contained in:
Yurong He
2019-04-25 19:45:33 -07:00
committed by GitHub
parent 3625834028
commit 23f4931a1d

View File

@@ -13,6 +13,7 @@ import { AppContext } from './common/appContext';
import { ApiWrapper } from './common/apiWrapper';
import { IExtensionApi } from './types';
import { CellType } from './contracts/content';
import { getErrorMessage } from './common/utils';
const localize = nls.loadMessageBundle();
@@ -133,7 +134,7 @@ async function openNotebook(): Promise<void> {
vscode.window.showTextDocument(doc);
}
} catch (err) {
vscode.window.showErrorMessage(err);
vscode.window.showErrorMessage(getErrorMessage(err));
}
}
@@ -146,7 +147,7 @@ async function runActiveCell(): Promise<void> {
throw new Error(noNotebookVisible);
}
} catch (err) {
vscode.window.showErrorMessage(err);
vscode.window.showErrorMessage(getErrorMessage(err));
}
}
@@ -159,7 +160,7 @@ async function runAllCells(): Promise<void> {
throw new Error(noNotebookVisible);
}
} catch (err) {
vscode.window.showErrorMessage(err);
vscode.window.showErrorMessage(getErrorMessage(err));
}
}
@@ -178,7 +179,7 @@ async function addCell(cellType: azdata.nb.CellType): Promise<void> {
throw new Error(noNotebookVisible);
}
} catch (err) {
vscode.window.showErrorMessage(err);
vscode.window.showErrorMessage(getErrorMessage(err));
}
}
@@ -221,4 +222,4 @@ export function deactivate() {
if (controller) {
controller.deactivate();
}
}
}