Fix deployment wizard to not close when cancelling out of password prompt (#14083)

This commit is contained in:
Charles Gagnon
2021-01-28 09:00:46 -08:00
committed by GitHub
parent 14cf6add73
commit 8677ffc68c
6 changed files with 27 additions and 108 deletions

View File

@@ -3,6 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import { ErrorType, ErrorWithType } from 'resource-deployment';
import { ToolsInstallPath } from '../constants';
import { ITool, NoteBookEnvironmentVariablePrefix } from '../interfaces';
@@ -12,6 +13,10 @@ export function getErrorMessage(error: any): string {
: typeof error === 'string' ? error : `${JSON.stringify(error, undefined, '\t')}`;
}
export function isUserCancelledError(err: any): boolean {
return err instanceof Error && 'type' in err && (<ErrorWithType>err).type === ErrorType.userCancelled;
}
export function getDateTimeString(): string {
return new Date().toISOString().slice(0, 19).replace(/[^0-9]/g, ''); // Take the date time information and only leaving the numbers
}