Skip to content

Commit 6eb5641

Browse files
committed
Add error callback
1 parent 17e347a commit 6eb5641

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

example/App.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,18 @@ export default function App() {
7979

8080
useEffect(() => {
8181
const start = async () => {
82-
await _connect();
82+
try {
83+
await _checkPermissions();
8384

84-
await _checkPermissions();
85-
await _subscribe();
86-
await _publish();
85+
await _connect();
86+
await _subscribe();
87+
await _publish();
88+
} catch (e) {
89+
Alert.alert(
90+
'Unknown error occured while connecting!',
91+
JSON.stringify(e.message ?? e),
92+
);
93+
}
8794
};
8895

8996
start();

0 commit comments

Comments
 (0)