From d2ce574294e4f3fb3fdab36e2631677f78a0a37b Mon Sep 17 00:00:00 2001 From: Eric Willhoit Date: Thu, 22 Feb 2024 11:09:22 -0600 Subject: [PATCH] fix: catch message lookup error (temp debug log) --- src/utils/progressBar.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/utils/progressBar.ts b/src/utils/progressBar.ts index 90995392..23a48a61 100644 --- a/src/utils/progressBar.ts +++ b/src/utils/progressBar.ts @@ -5,13 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ - import { envVars as env, EnvironmentVariable, Lifecycle, Messages } from '@salesforce/core'; import { MetadataApiDeploy, MetadataApiDeployStatus } from '@salesforce/source-deploy-retrieve'; import { Progress } from '@salesforce/sf-plugins-core'; import { SourceMemberPollingEvent } from '@salesforce/source-tracking'; +import { ux } from '@oclif/core'; -Messages.importMessagesDirectoryFromMetaUrl(import.meta.url) +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer'); const showBar = Boolean( @@ -84,7 +84,15 @@ export class DeployProgress extends Progress { testInfo, }); } else { - this.update(0, { errorInfo, testInfo, status: mdTransferMessages.getMessage(data.status) ?? 'Waiting' }); + ux.debug(`Deploy Progress Status (else): ${data.status}`); + let status; + try { + status = mdTransferMessages.getMessage(data.status); + } catch (e) { + ux.debug(`data.status message lookup failed for: ${data.status}`); + status = 'Waiting'; + } + this.update(0, { errorInfo, testInfo, status }); } } }