Skip to content

Commit

Permalink
fix error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
benisgold committed Dec 1, 2023
1 parent 89277e3 commit 7124073
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/screens/points/ConsoleSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export const ConsoleSheet = () => {
}
}
if (!points) {
logger.error(
new RainbowError(
`Error onboarding points user - accountAddress: ${accountAddress}, referralCode: ${referralCode}, challenge: ${challenge}, signature: ${signature}`
)
);
logger.error(new RainbowError('Error onboarding points user'), {
referralCode,
challenge,
signature,
});
Alert.alert(i18n.t(i18n.l.points.console.generic_alert));
} else {
if (points.onboardPoints?.error) {
Expand Down
7 changes: 6 additions & 1 deletion src/screens/points/content/ReferralContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Svg, { Path } from 'react-native-svg';
import { WrappedAlert as Alert } from '@/helpers/alert';
import * as i18n from '@/languages';
import Routes from '@/navigation/routesNames';
import { RainbowError, logger } from '@/logger';

export default function ReferralContent() {
const { accountAddress } = useAccountProfile();
Expand Down Expand Up @@ -66,8 +67,12 @@ export default function ReferralContent() {
if (res.onboardPoints.error.type === 'INVALID_REFERRAL_CODE') {
setStatus('invalid');
haptics.notificationError();
} else {
logger.error(new RainbowError('Error validating referral code'), {
referralCode,
});
Alert.alert(i18n.t(i18n.l.points.referral.error));
}
Alert.alert(i18n.t(i18n.l.points.referral.error));
} else {
setStatus('valid');
setReferralCode(referralCode);
Expand Down

0 comments on commit 7124073

Please sign in to comment.