Skip to content

Commit

Permalink
#1807: gray out warnings if the event/journey is not published
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Nov 8, 2024
1 parent e5e4954 commit 241b9db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
12 changes: 5 additions & 7 deletions lib/metadataTypes/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class Event extends MetadataType {
delete metadata.arguments?.automationId;
}
} catch (ex) {
Util.logger.verbose(
Util.logger.warn(
` - ${this.definition.type} ${metadata[this.definition.nameField]} (${
metadata[this.definition.keyField]
}): ${ex.message}.`
Expand Down Expand Up @@ -545,9 +545,8 @@ class Event extends MetadataType {
metadata.publishedInteractionCount >= 1
);
} catch (ex) {
Util.logger.warn(
` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}) with ${metadata.publishedInteractionCount} active journeys: ${ex.message}`
);
const msg = ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}) with ${metadata.publishedInteractionCount} active journeys: ${ex.message}`;
Util.logger.warn(metadata.publishedInteractionCount === 0 ? Util.getGrayMsg(msg) : msg);
}
try {
await this.compareSalesforceEntryEvents_dataExtension(
Expand All @@ -556,9 +555,8 @@ class Event extends MetadataType {
metadata.r__dataExtension_key
);
} catch (ex) {
Util.logger.warn(
` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}) with ${metadata.publishedInteractionCount} active journeys: ${ex.message}`
);
const msg = ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}) with ${metadata.publishedInteractionCount} active journeys: ${ex.message}`;
Util.logger.warn(metadata.publishedInteractionCount === 0 ? Util.getGrayMsg(msg) : msg);
}

return metadata;
Expand Down
17 changes: 10 additions & 7 deletions lib/metadataTypes/Journey.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,11 @@ class Journey extends MetadataType {
delete config.eventDefinitionKey;
delete config.eventDefinitionId;
} catch (ex) {
const msg = ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${
metadata[this.definition.keyField]
}) ${metadata.status}: ${ex.message}.`;
Util.logger.warn(
` - ${this.definition.type} ${metadata[this.definition.nameField]} (${
metadata[this.definition.keyField]
}): ${ex.message}.`
metadata.status === 'Published' ? msg : Util.getGrayMsg(msg)
);
}
}
Expand Down Expand Up @@ -440,8 +441,9 @@ class Journey extends MetadataType {
this.definition.type
);
} catch (ex) {
const msg = ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}) ${metadata.status}: ${ex.message}`;
Util.logger.warn(
` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${metadata[this.definition.keyField]}): ${ex.message}`
metadata.status === 'Published' ? msg : Util.getGrayMsg(msg)
);
}
}
Expand Down Expand Up @@ -1034,10 +1036,11 @@ class Journey extends MetadataType {
);
delete triggeredSend.emailId;
} catch {
const msg = ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${
metadata[this.definition.keyField]
}): Could not find email with ID ${triggeredSend.emailId} in Classic nor in Content Builder.`;
Util.logger.warn(
` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${
metadata[this.definition.keyField]
}): Could not find email with ID ${triggeredSend.emailId} in Classic nor in Content Builder.`
metadata.status === 'Published' ? msg : Util.getGrayMsg(msg)
);
}
}
Expand Down

0 comments on commit 241b9db

Please sign in to comment.