Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: version deprecation failure false positive #3104

Merged
merged 11 commits into from
Feb 28, 2024
8 changes: 4 additions & 4 deletions src/v0/destinations/gainsight_px/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ const { getDynamicErrorType } = require('../../../adapters/utils/networkUtils');
const { JSON_MIME_TYPE } = require('../../util/constant');

const handleErrorResponse = (error, customErrMessage, expectedErrStatus, defaultStatus = 400) => {
let destResp;
let errMessage = '';
let errorStatus = defaultStatus;

if (error.response && error.response.data) {
errMessage = error.response.data.externalapierror
? JSON.stringify(error.response.data.externalapierror)
: JSON.stringify(error.response.data);
destResp = error.response?.data?.externalapierror ?? error.response?.data;
errMessage = JSON.stringify(destResp);

errorStatus = error.response.status;

Expand All @@ -26,7 +26,7 @@ const handleErrorResponse = (error, customErrMessage, expectedErrStatus, default
{
[tags.TAG_NAMES.ERROR_TYPE]: getDynamicErrorType(errorStatus),
},
error,
destResp,
);
};

Expand Down
Loading
Loading