Remove command link from deployment error (#12573)

This commit is contained in:
Charles Gagnon
2020-09-22 14:16:40 -07:00
committed by GitHub
parent 95752a7de5
commit 4f433772af
8 changed files with 28 additions and 7 deletions

View File

@@ -189,8 +189,12 @@ export async function promptAndConfirmPassword(validate: (input: string) => stri
/**
* Gets the message to display for a given error object that may be a variety of types.
* @param error The error object
* @param useMessageWithLink Whether to use the messageWithLink - if available
*/
export function getErrorMessage(error: any): string {
export function getErrorMessage(error: any, useMessageWithLink: boolean = false): string {
if (useMessageWithLink && error.messageWithLink) {
return error.messageWithLink;
}
return error.message ?? error;
}

View File

@@ -163,7 +163,7 @@ export function instanceDeletionWarning(name: string): string { return localize(
export function invalidInstanceDeletionName(name: string): string { return localize('arc.invalidInstanceDeletionName', "The value '{0}' does not match the instance name. Try again or press escape to exit", name); }
export function couldNotFindAzureResource(name: string): string { return localize('arc.couldNotFindAzureResource', "Could not find Azure resource for {0}", name); }
export function passwordResetFailed(error: any): string { return localize('arc.passwordResetFailed', "Failed to reset password. {0}", getErrorMessage(error)); }
export function errorConnectingToController(error: any): string { return localize('arc.errorConnectingToController', "Error connecting to controller. {0}", getErrorMessage(error)); }
export function errorConnectingToController(error: any): string { return localize('arc.errorConnectingToController', "Error connecting to controller. {0}", getErrorMessage(error, true)); }
export function passwordAcquisitionFailed(error: any): string { return localize('arc.passwordAcquisitionFailed', "Failed to acquire password. {0}", getErrorMessage(error)); }
export const invalidPassword = localize('arc.invalidPassword', "The password did not work, try again.");
export function errorVerifyingPassword(error: any): string { return localize('arc.errorVerifyingPassword', "Error encountered while verifying password. {0}", getErrorMessage(error)); }