From fc153d14e150b98b7b45f59286071652f90108c6 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Mon, 24 Jun 2024 20:26:00 +0530 Subject: [PATCH] chore: handle too many soql queries in salesforce --- src/v0/destinations/salesforce/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/v0/destinations/salesforce/utils.js b/src/v0/destinations/salesforce/utils.js index 85061ce2b2..bb1236d290 100644 --- a/src/v0/destinations/salesforce/utils.js +++ b/src/v0/destinations/salesforce/utils.js @@ -58,12 +58,13 @@ const salesforceResponseHandler = (destResponse, sourceMessage, authKey, authori } else if ( status === 400 && matchErrorCode('CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY') && - response?.message?.includes('UNABLE_TO_LOCK_ROW') + (response?.message?.includes('UNABLE_TO_LOCK_ROW') || + response?.message?.includes('Too many SOQL queries')) ) { // handling the error case where the record is locked by another background job // this is a retryable error throw new RetryableError( - `${DESTINATION} Request Failed - "Row locked due to another background running on the same object", (Retryable) ${sourceMessage}`, + `${DESTINATION} Request Failed - "${response.message}", (Retryable) ${sourceMessage}`, 500, destResponse, );