Skip to content

Commit 8457854

Browse files
authored
Merge pull request #48 from FormidableLabs/feature/no-red-screen-of-death
Use less scary error handling in the example app
2 parents 82ea58a + 188024b commit 8457854

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Example/App.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { UIManager, LayoutAnimation } from 'react-native';
2+
import { UIManager, LayoutAnimation, Alert } from 'react-native';
33
import { authorize, refresh, revoke } from 'react-native-app-auth';
44
import { Page, Button, ButtonContainer, Form, Heading } from './components';
55

@@ -52,7 +52,7 @@ export default class App extends Component<{}, State> {
5252
500
5353
);
5454
} catch (error) {
55-
console.error(error);
55+
Alert.alert('Failed to log in', error.message);
5656
}
5757
};
5858

@@ -69,7 +69,7 @@ export default class App extends Component<{}, State> {
6969
refreshToken: authState.refreshToken || this.state.refreshToken
7070
});
7171
} catch (error) {
72-
console.error(error);
72+
Alert.alert('Failed to refresh token', error.message);
7373
}
7474
};
7575

@@ -85,7 +85,7 @@ export default class App extends Component<{}, State> {
8585
refreshToken: ''
8686
});
8787
} catch (error) {
88-
console.error(error);
88+
Alert.alert('Failed to revoke token', error.message);
8989
}
9090
};
9191

0 commit comments

Comments
 (0)