From 42bec546cc9159a8cc496a7b01a08a9171c02aff Mon Sep 17 00:00:00 2001 From: Gauravudia <60897972+Gauravudia@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:46:08 +0530 Subject: [PATCH] chore: add error import from lib for missing integrations (#2818) --- src/legacy/router.js | 2 +- src/v0/destinations/facebook_conversions/transform.js | 3 +-- src/v0/destinations/facebook_conversions/utils.js | 2 +- src/v0/sources/appcenter/transform.js | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/legacy/router.js b/src/legacy/router.js index 99fb8570fb..f8deb3fe62 100644 --- a/src/legacy/router.js +++ b/src/legacy/router.js @@ -7,6 +7,7 @@ const Router = require('@koa/router'); const lodash = require('lodash'); const fs = require('fs'); const path = require('path'); +const { PlatformError } = require('@rudderstack/integrations-lib'); const logger = require('../logger'); const stats = require('../util/stats'); const { SUPPORTED_VERSIONS, API_VERSION } = require('../routes/utils/constants'); @@ -35,7 +36,6 @@ const { sendViolationMetrics, constructValidationErrors, } = require('../util/utils'); -const { PlatformError } = require('../v0/util/errorTypes'); const { processCdkV1 } = require('../cdk/v1/handler'); const { extractLibraries } = require('../util/customTransformer'); const { getCompatibleStatusCode } = require('../adapters/utils/networkUtils'); diff --git a/src/v0/destinations/facebook_conversions/transform.js b/src/v0/destinations/facebook_conversions/transform.js index dec1ef2e6c..cf11795605 100644 --- a/src/v0/destinations/facebook_conversions/transform.js +++ b/src/v0/destinations/facebook_conversions/transform.js @@ -1,6 +1,7 @@ /* eslint-disable no-param-reassign */ const get = require('get-value'); const moment = require('moment'); +const { InstrumentationError, ConfigurationError } = require('@rudderstack/integrations-lib'); const { CONFIG_CATEGORIES, MAPPING_CONFIG, @@ -34,8 +35,6 @@ const { formingFinalResponse, } = require('../../util/facebookUtils'); -const { InstrumentationError, ConfigurationError } = require('../../util/errorTypes'); - const responseBuilderSimple = (message, category, destination) => { const { Config, ID } = destination; let { categoryToContent } = Config; diff --git a/src/v0/destinations/facebook_conversions/utils.js b/src/v0/destinations/facebook_conversions/utils.js index 270fac8c45..32fafae3d0 100644 --- a/src/v0/destinations/facebook_conversions/utils.js +++ b/src/v0/destinations/facebook_conversions/utils.js @@ -1,3 +1,4 @@ +const { InstrumentationError } = require('@rudderstack/integrations-lib'); const { CONFIG_CATEGORIES, OTHER_STANDARD_EVENTS, @@ -8,7 +9,6 @@ const { } = require('./config'); const { constructPayload, isObject, isAppleFamily } = require('../../util'); const { getContentType, getContentCategory } = require('../../util/facebookUtils'); -const { InstrumentationError } = require('../../util/errorTypes'); const getActionSource = (payload, fallbackActionSource) => { let actionSource = fallbackActionSource; diff --git a/src/v0/sources/appcenter/transform.js b/src/v0/sources/appcenter/transform.js index 3a98a6db3e..40399d92e2 100644 --- a/src/v0/sources/appcenter/transform.js +++ b/src/v0/sources/appcenter/transform.js @@ -1,5 +1,6 @@ const path = require('path'); const fs = require('fs'); +const { TransformationError } = require('@rudderstack/integrations-lib'); const { generateUUID } = require('../../util'); const Message = require('../message'); @@ -7,7 +8,6 @@ const mappingJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, './mappin const { removeUndefinedAndNullValues } = require('../../util'); -const { TransformationError } = require('../../util/errorTypes'); const { JSON_MIME_TYPE } = require('../../util/constant'); const processNormalEvent = (event) => {