Skip to content

Commit

Permalink
#1676: fix graceful handling of "key not found" error for journey and…
Browse files Browse the repository at this point in the history
… event
  • Loading branch information
JoernBerkefeld committed Sep 5, 2024
1 parent 41a9454 commit 04754c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/metadataTypes/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class Event extends MetadataType {
* @param {string} [key] customer key of single item to retrieve
* @returns {Promise.<MetadataTypeMapObj>} Promise of metadata
*/
static retrieve(retrieveDir, _, __, key) {
static async retrieve(retrieveDir, _, __, key) {
Util.logBeta(this.definition.type);
try {
return super.retrieveREST(
return await super.retrieveREST(
retrieveDir,
`/interaction/v1/eventDefinitions${
key ? '/key:' + encodeURIComponent(key) : ''
Expand Down
2 changes: 1 addition & 1 deletion lib/metadataTypes/Journey.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class Journey extends MetadataType {
// if the interaction does not exist, the API returns an error code which would otherwise bring execution to a hold
if (
[
'Journey matching key not found.',
'Interaction matching key not found.',
'Must provide a valid ID or Key parameter',
].includes(ex.message)
) {
Expand Down

0 comments on commit 04754c8

Please sign in to comment.