Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 474872f

Browse files
chore: testing rollbar
1 parent f8ebe4f commit 474872f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/renderer/components/Votes/Votes.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { useInView } from 'framer-motion';
33
import { useMutation, useQuery } from '@apollo/client';
44
import { Flex, FlexProps, IconButton, Text, Tooltip } from '@chakra-ui/react';
55
import { DownVoteIcon, UpVoteIcon, useToast } from '@codiga/components';
6+
import { LogArgument } from 'rollbar';
7+
import { useRollbar } from '@rollbar/react';
68

79
import { useUser } from '../UserContext';
810
import {
@@ -30,6 +32,7 @@ export default function Votes({
3032
}: VotesProps) {
3133
const toast = useToast();
3234
const { id: userId } = useUser();
35+
const rollbar = useRollbar();
3336

3437
const ref = useRef(null);
3538
const isInView = useInView(ref);
@@ -65,6 +68,9 @@ export default function Votes({
6568
description: 'Snippet upvoted',
6669
});
6770
} catch (err) {
71+
rollbar.error('Error upvoting', err as LogArgument, {
72+
hello: 'world',
73+
});
6874
toast({
6975
status: 'error',
7076
description: 'An error occured while upvoting. Please refresh.',
@@ -85,6 +91,9 @@ export default function Votes({
8591
description: 'Snippet downvoted.',
8692
});
8793
} catch (err) {
94+
rollbar.error('Error downvoting', err as LogArgument, {
95+
hello: 'world',
96+
});
8897
toast({
8998
status: 'error',
9099
description: 'An error occured while downvoting. Please refresh.',

0 commit comments

Comments
 (0)