From bc09a72f18538cae8377babe2bb6a1d991cd67fe Mon Sep 17 00:00:00 2001 From: Ildar Galeev Date: Wed, 11 Sep 2024 16:47:08 +0700 Subject: [PATCH] Disable requisites errors logging (#341) --- .../ViewContainer/ApiExtensionView/useDestinations.ts | 3 +-- src/components/ViewContainer/ApiExtensionView/useGateways.ts | 3 +-- src/components/ViewContainer/ApiExtensionView/useRequisites.ts | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/ViewContainer/ApiExtensionView/useDestinations.ts b/src/components/ViewContainer/ApiExtensionView/useDestinations.ts index 149b2684..b3c0f1b2 100644 --- a/src/components/ViewContainer/ApiExtensionView/useDestinations.ts +++ b/src/components/ViewContainer/ApiExtensionView/useDestinations.ts @@ -1,7 +1,7 @@ import { useCallback, useReducer, useRef } from 'react'; import { BusinessError, Destination, getDestinations as getApiDestinations } from 'checkout/backend/p2p'; -import { extractError, isNil, withRetry } from 'checkout/utils'; +import { isNil, withRetry } from 'checkout/utils'; type State = | { status: 'PRISTINE' | 'LOADING' } @@ -74,7 +74,6 @@ export const useDestinations = (capiEndpoint: string, accessToken: string, invoi throw new Error('Unknown getDestinations response format.'); } catch (error) { dispatch({ type: 'FETCH_FAILURE', error }); - console.error(`Failed to fetch destinations. ${extractError(error)}`); } }, [capiEndpoint, accessToken, invoiceID, paymentID], diff --git a/src/components/ViewContainer/ApiExtensionView/useGateways.ts b/src/components/ViewContainer/ApiExtensionView/useGateways.ts index 942e3040..54e3dd07 100644 --- a/src/components/ViewContainer/ApiExtensionView/useGateways.ts +++ b/src/components/ViewContainer/ApiExtensionView/useGateways.ts @@ -1,7 +1,7 @@ import { useCallback, useReducer } from 'react'; import { BusinessError, Gateway, getGateways as getApiGateways } from 'checkout/backend/p2p'; -import { extractError, isNil, withRetry } from 'checkout/utils'; +import { isNil, withRetry } from 'checkout/utils'; type State = | { status: 'PRISTINE' | 'LOADING' } @@ -60,7 +60,6 @@ export const useGateways = (capiEndpoint: string, accessToken: string, invoiceID throw new Error('Unknown getGateways response format.'); } catch (error) { dispatch({ type: 'FETCH_FAILURE', error }); - console.error(`Failed to fetch gateways. ${extractError(error)}`); } }, [capiEndpoint, accessToken, invoiceID, paymentID]); diff --git a/src/components/ViewContainer/ApiExtensionView/useRequisites.ts b/src/components/ViewContainer/ApiExtensionView/useRequisites.ts index abdfba9e..1eb1ebc5 100644 --- a/src/components/ViewContainer/ApiExtensionView/useRequisites.ts +++ b/src/components/ViewContainer/ApiExtensionView/useRequisites.ts @@ -64,7 +64,6 @@ export const useRequisites = ( dispatch({ type: 'FETCH_FAILURE' }); } if (gatewaysState.status === 'BUSINESS_ERROR') { - console.error(`Failed to fetch gateways. Business Error: ${gatewaysState.error.errorMessage}`); dispatch({ type: 'FETCH_FAILURE' }); } }, [gatewaysState]); @@ -77,7 +76,6 @@ export const useRequisites = ( dispatch({ type: 'FETCH_FAILURE' }); } if (destinationsState.status === 'FETCH_BUSINESS_ERROR') { - console.error(`Failed to fetch destinations. Business Error: ${destinationsState.error.errorMessage}`); dispatch({ type: 'FETCH_FAILURE' }); } }, [destinationsState]);