Skip to content

Commit

Permalink
Disable requisites errors logging (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
KeinAsylum authored Sep 11, 2024
1 parent 8660737 commit bc09a72
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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' }
Expand Down Expand Up @@ -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],
Expand Down
3 changes: 1 addition & 2 deletions src/components/ViewContainer/ApiExtensionView/useGateways.ts
Original file line number Diff line number Diff line change
@@ -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' }
Expand Down Expand Up @@ -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]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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]);
Expand Down

0 comments on commit bc09a72

Please sign in to comment.