diff --git a/src/adapters/utils/networkUtils.js b/src/adapters/utils/networkUtils.js index a88d803fac..7f830f5a4b 100644 --- a/src/adapters/utils/networkUtils.js +++ b/src/adapters/utils/networkUtils.js @@ -71,6 +71,14 @@ const nodeSysErrorToStatus = (code) => { status: 500, message: '[ETIMEDOUT] :: Operation timed out', }, + EAI_AGAIN: { + status: 500, + message: '[EAI_AGAIN] :: Temporary failure in name resolution', + }, + ECONNABORTED: { + status: 500, + message: '[ECONNABORTED] :: Connection aborted', + }, }; return sysErrorToStatusMap[code] || { status: 400, message: `[${code}]` }; }; diff --git a/test/__mocks__/data/salesforce/proxy_response.json b/test/__mocks__/data/salesforce/proxy_response.json index 2ce60e4ec9..a92edc58c2 100644 --- a/test/__mocks__/data/salesforce/proxy_response.json +++ b/test/__mocks__/data/salesforce/proxy_response.json @@ -1,4 +1,14 @@ { + "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101": { + "message": "Connection Aborted", + "name": "Error", + "code": "ECONNABORTED" + }, + "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/102": { + "message": "DNS not found", + "name": "Error", + "code": "EAI_AGAIN" + }, "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/1": { "response": { "data": { diff --git a/test/__tests__/data/salesforce_proxy_input.json b/test/__tests__/data/salesforce_proxy_input.json index f7b8257510..f1aeef71ab 100644 --- a/test/__tests__/data/salesforce_proxy_input.json +++ b/test/__tests__/data/salesforce_proxy_input.json @@ -1,4 +1,70 @@ [ + { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/101", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, + { + "type": "REST", + "files": {}, + "method": "POST", + "userId": "", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token" + }, + "version": "1", + "endpoint": "https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/102", + "body": { + "XML": {}, + "FORM": {}, + "JSON": { + "Email": "denis.kornilov@sbermarket.ru", + "Company": "sbermarket.ru", + "LastName": "Корнилов", + "FirstName": "Денис", + "LeadSource": "App Signup", + "account_type__c": "free_trial" + }, + "JSON_ARRAY": {} + }, + "metadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + }, + "params": { + "destination": "salesforce" + } + }, { "type": "REST", "files": {}, diff --git a/test/__tests__/data/salesforce_proxy_output.json b/test/__tests__/data/salesforce_proxy_output.json index e5fc2f0bb3..c900661b75 100644 --- a/test/__tests__/data/salesforce_proxy_output.json +++ b/test/__tests__/data/salesforce_proxy_output.json @@ -1,4 +1,54 @@ [ + { + "output": { + "status": 500, + "message": "Salesforce Request Failed - due to \"\"[ECONNABORTED] :: Connection aborted\"\", (Retryable) during Salesforce Response Handling", + "destinationResponse": { + "response": "[ECONNABORTED] :: Connection aborted", + "status": 500, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + }, + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + }, + { + "output": { + "status": 500, + "message": "Salesforce Request Failed - due to \"\"[EAI_AGAIN] :: Temporary failure in name resolution\"\", (Retryable) during Salesforce Response Handling", + "destinationResponse": { + "response": "[EAI_AGAIN] :: Temporary failure in name resolution", + "status": 500, + "rudderJobMetadata": { + "destInfo": { + "authKey": "2HezPl1w11opbFSxnLDEgZ7kWTf" + } + } + }, + "statTags": { + "destType": "SALESFORCE", + "errorCategory": "network", + "destinationId": "Non-determininable", + "workspaceId": "Non-determininable", + "errorType": "retryable", + "feature": "dataDelivery", + "implementation": "native", + "module": "destination" + } + } + }, { "output": { "status": 200, @@ -207,4 +257,4 @@ } } } -] +] \ No newline at end of file