Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async onStartReaderSettings() {
const { navigate } = this.props.navigation;
try {
await startReaderSettingsAsync();
} catch (ex) {
let errorMessage = ex.message;
switch (ex.code) {
case ReaderSettingsErrorSdkNotAuthorized:
// Handle reader settings not authorized
navigate('Deauthorizing');
break;
case UsageError:
default:
if (__DEV__) {
errorMessage += `\n\nDebug Message: ${ex.debugMessage}`;
console.log(`${ex.code}:${ex.debugCode}:${ex.debugMessage}`);
}
Alert.alert('Error', errorMessage);
break;
}