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

[CP Staging] Include more information in Onfido API error handling #6091

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/Onfido/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import './index.css';
import lodashGet from 'lodash/get';
import React from 'react';
import * as OnfidoSDK from 'onfido-sdk-ui';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';
Expand Down Expand Up @@ -85,8 +84,7 @@ class Onfido extends React.Component {
showCountrySelection: false,
onComplete: this.props.onSuccess,
onError: (error) => {
const errorMessage = lodashGet(error, 'message', CONST.ERROR.UNKNOWN_ERROR);
this.props.onError(errorMessage);
this.props.onError(error);
},
onUserExit: this.props.onUserExit,
onModalRequestClose: () => {},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReimbursementAccount/RequestorStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class RequestorStep extends React.Component {
}}
onError={(error) => {
// In case of any unexpected error we log it to the server, show a growl, and return the user back to the company step so they can try again.
Log.hmmm('Onfido error in RequestorStep', {error});
Log.hmmm('Onfido error in RequestorStep', error);
Growl.error(this.props.translate('onfidoStep.genericError'), 10000);
goToWithdrawalAccountSetupStep(CONST.BANK_ACCOUNT.STEP.COMPANY);
}}
Expand Down