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;
}