From 56c80f2c47ca0aa8411a1cc16462b98dfecb4a79 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:20:38 +0530 Subject: [PATCH] chore: update error messages of GAOC (#2655) --- .../google_adwords_offline_conversions/transform.js | 4 +++- .../google_adwords_offline_conversions/utils.js | 6 ++++-- test/__tests__/data/google_adwords_offline_conversions.json | 4 ++-- .../google_adwords_offline_conversions_router_output.json | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/v0/destinations/google_adwords_offline_conversions/transform.js b/src/v0/destinations/google_adwords_offline_conversions/transform.js index 93b4592c33..a4bd218673 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/transform.js +++ b/src/v0/destinations/google_adwords_offline_conversions/transform.js @@ -100,7 +100,9 @@ const trackResponseBuilder = (message, metadata, destination) => { const responseList = []; if (!eventsToConversionsNamesMapping[event] || !eventsToOfflineConversionsTypeMapping[event]) { - throw new ConfigurationError(`Event name '${event}' is not valid`); + throw new ConfigurationError( + `Event name '${event}' is not present in the mapping provided in the dashboard.`, + ); } const conversionTypes = Array.from(eventsToOfflineConversionsTypeMapping[event]); conversionTypes.forEach((conversionType) => { diff --git a/src/v0/destinations/google_adwords_offline_conversions/utils.js b/src/v0/destinations/google_adwords_offline_conversions/utils.js index 6bdedcc0d4..a39c984788 100644 --- a/src/v0/destinations/google_adwords_offline_conversions/utils.js +++ b/src/v0/destinations/google_adwords_offline_conversions/utils.js @@ -76,7 +76,9 @@ const getConversionActionId = async (headers, params) => { 'response.0.results.0.conversionAction.resourceName', ); if (!conversionAction) { - throw new AbortedError(`Unable to find conversionActionId for conversion:${params.event}`); + throw new AbortedError( + `Unable to find conversionActionId for conversion:${params.event}. Most probably the conversion name in Google dashboard and Rudderstack dashboard are not same.`, + ); } return conversionAction; }); @@ -172,7 +174,7 @@ const requestBuilder = ( const filteredLoginCustomerId = removeHyphens(loginCustomerId); response.headers['login-customer-id'] = filteredLoginCustomerId; } else { - throw new ConfigurationError(`loginCustomerId is required as subAccount is enabled`); + throw new ConfigurationError(`"Login Customer ID" is required as "Sub Account" is enabled`); } } return response; diff --git a/test/__tests__/data/google_adwords_offline_conversions.json b/test/__tests__/data/google_adwords_offline_conversions.json index 3c7b54ac4c..36eab5ac22 100644 --- a/test/__tests__/data/google_adwords_offline_conversions.json +++ b/test/__tests__/data/google_adwords_offline_conversions.json @@ -1622,7 +1622,7 @@ } }, "statusCode": 400, - "error": "Event name 'purchase' is not valid", + "error": "Event name 'purchase' is not present in the mapping provided in the dashboard.", "statTags": { "destination": "google_adwords_offline_conversions", "stage": "transform", @@ -2948,7 +2948,7 @@ "secret": null }, "statusCode": 400, - "error": "loginCustomerId is required as subAccount is enabled", + "error": "\"Login Customer ID\" is required as \"Sub Account\" is enabled", "statTags": { "destination": "google_adwords_offline_conversions", "stage": "transform", diff --git a/test/__tests__/data/google_adwords_offline_conversions_router_output.json b/test/__tests__/data/google_adwords_offline_conversions_router_output.json index 16b07233e3..2424e51002 100644 --- a/test/__tests__/data/google_adwords_offline_conversions_router_output.json +++ b/test/__tests__/data/google_adwords_offline_conversions_router_output.json @@ -472,7 +472,7 @@ ], "batched": false, "statusCode": 400, - "error": "Event name 'order completed' is not valid", + "error": "Event name 'order completed' is not present in the mapping provided in the dashboard.", "statTags": { "errorCategory": "dataValidation", "errorType": "configuration" }, "destination": { "Config": {