Disable requisites errors logging (#341)

This commit is contained in:
Ildar Galeev 2024-09-11 16:47:08 +07:00 committed by GitHub
parent 8660737b64
commit bc09a72f18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 6 deletions

View File

@ -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],

View File

@ -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]);

View File

@ -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]);