Skip to content

Commit

Permalink
Add bugsnag report to register the apple/google account
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunnini committed Apr 22, 2024
1 parent 21b88e6 commit dbd3af1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/mobile/src/screen/register/apple-sign-in/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {Buffer} from 'buffer/';
import {observer} from 'mobx-react-lite';
import {useStore} from '../../../stores';
import {Platform} from 'react-native';
import Bugsnag from '@bugsnag/react-native';

export const RegisterAppleSignInScreen: FunctionComponent = observer(() => {
const {uiConfigStore} = useStore();
Expand Down Expand Up @@ -61,6 +62,20 @@ export const RegisterAppleSignInScreen: FunctionComponent = observer(() => {
setKey(res);
} catch (e) {
console.log(e);
if (e instanceof Error) {
Bugsnag.notify(e);
} else if (typeof e === 'string') {
Bugsnag.notify(new Error(e));
} else {
if (
e &&
typeof e === 'object' &&
e.message &&
typeof e.message === 'string'
) {
Bugsnag.notify(new Error(e.message));
}
}
navigation.goBack();
} finally {
if (Platform.OS === 'ios') {
Expand Down
15 changes: 15 additions & 0 deletions packages/mobile/src/screen/register/google-sign-in/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {Buffer} from 'buffer/';
import {Platform} from 'react-native';
import {observer} from 'mobx-react-lite';
import {useStore} from '../../../stores';
import Bugsnag from '@bugsnag/react-native';

export const RegisterGoogleSignInScreen: FunctionComponent = observer(() => {
const {uiConfigStore} = useStore();
Expand Down Expand Up @@ -60,6 +61,20 @@ export const RegisterGoogleSignInScreen: FunctionComponent = observer(() => {
setKey(res);
} catch (e) {
console.log(e);
if (e instanceof Error) {
Bugsnag.notify(e);
} else if (typeof e === 'string') {
Bugsnag.notify(new Error(e));
} else {
if (
e &&
typeof e === 'object' &&
e.message &&
typeof e.message === 'string'
) {
Bugsnag.notify(new Error(e.message));
}
}
navigation.goBack();
} finally {
if (Platform.OS === 'ios') {
Expand Down

0 comments on commit dbd3af1

Please sign in to comment.