react-native-sdk
react-native-sdk copied to clipboard
Error codes not being propagated to the JS handler
Summary
The error rejected by Onfido.start()
doesn't include the error code (e.g. cameraPermission
)
Description
Regarding the error rejected by Onfido.start()
, I see you use the following format:
{
code: 'error',
domain: 'Onfido.OnfidoFlowError',
message: 'Encountered an error: cameraPermission'
}
The issue with this is that, in order to properly handle the permission error, one should parse the error message and find the cameraPermission
code.
Possibile solution
Would it be possibile to use it as value of the code
property of the error object?
Also, I don't see the possible errors documented anywhere. It may make sense to document those somewhere, if you haven't already!