From 1767d48f7593af6e9be956225035e8daf642ba91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 24 Jul 2023 10:46:19 +0200 Subject: [PATCH] #1043: improve CLI logs --- lib/metadataTypes/Automation.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 05368355c..579cb2bd7 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -144,11 +144,17 @@ class Automation extends MetadataType { })); found++; } else { - throw new TypeError(JSON.stringify(notificationsResult)); + if ( + Object.keys(notificationsResult).length !== 1 || + !notificationsResult?.programId + ) { + throw new TypeError(JSON.stringify(notificationsResult)); + } + // * if there are no automation notifications, the API returns a single object with the programId } } catch (ex) { Util.logger.debug( - ` ☇ skipping Notifications for Automation ${automationLegacy.key}: ${ex.message} ${ex.code}` + ` ☇ issue retrieving Notifications for automation ${automationLegacy.key}: ${ex.message} ${ex.code}` ); skipped++; } @@ -397,14 +403,22 @@ class Automation extends MetadataType { activity.activityObjectId == null ) { Util.logger.debug( - ` - skip parsing of activity due to missing activityObjectId: ${JSON.stringify( - activity - )}` + ` - skipping ${ + metadata[this.definition.keyField] + } activity ${stepNumber}.${ + activity.displayOrder + } due to missing activityObjectId: ${JSON.stringify(activity)}` ); // empty if block } else if (!this.definition.dependencies.includes(activity.r__type)) { Util.logger.debug( - ` - skip parsing because the type is not set up as a dependecy for ${this.definition.type}` + ` - skipping ${ + metadata[this.definition.keyField] + } activity ${stepNumber}.${ + activity.displayOrder + } because the type ${ + activity.r__type + } is not set up as a dependency for ${this.definition.type}` ); } // / if managed by cache we can update references to support deployment