Function: setErrorHandler()
setErrorHandler():
Promise
<void
>
Description
Set error handler.
Error events that the client or application can receive after a call to setErrorHandler()
will be received as a callback in NativeEventEmitter
. To receive error events, you must have registered a listener with the tag ErrorEvent
:
Example
const eventEmitter =
Platform.OS === 'ios'
? new NativeEventEmitter(NativeModules.FordefiSdk)
: new NativeEventEmitter(NativeModules.FordefiSdkModule);
eventEmitter.addListener('ErrorEvent', (event) => {
console.log('Error ${event.errorCode}: ${event.errorMessage}');
});
For more information, see Add error handling.
Throws
Returns
Promise
< void
>
A Promise that returns a secret when the operation is successful.