Skip to content

Commit

Permalink
analitics sending fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 committed Aug 19, 2024
1 parent d55fef3 commit 9ebd548
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions components/swap/SwapReviewRouteInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ const SwapReviewRouteInfo = ({
})
actions.fetchWalletTokens(wallet.publicKey)
} catch (e) {
sentry.captureException({ e, txid, origin: selectedRoute.origin })
sentry.captureException(`${{ e, txid, origin: selectedRoute.origin }}`)
console.log('error swapping wallet tokens', e)
} finally {
setSubmitting(false)
Expand Down Expand Up @@ -543,7 +543,7 @@ const SwapReviewRouteInfo = ({
'onSwapError',
)
console.error('onSwap error: ', e)
sentry.captureException({ e, tx, origin: selectedRoute.origin })
sentry.captureException(`${{ e, tx, origin: selectedRoute.origin }}`)
if (isMangoError(e)) {
const slippageExceeded = await parseTxForKnownErrors(
connection,
Expand Down Expand Up @@ -602,7 +602,7 @@ const SwapReviewRouteInfo = ({
setSubmitting(false)
}
} catch (e) {
sentry.captureException({ e, origin: selectedRoute.origin })
sentry.captureException(`${{ e, origin: selectedRoute.origin }}`)
console.error('Swap error:', e)
} finally {
if (!directRouteFallbackUsed) {
Expand Down
8 changes: 4 additions & 4 deletions components/swap/SwapTriggerOrders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const handleCancelTriggerOrder = async (
await actions.reloadMangoAccount(slot)
} catch (e) {
console.error('failed to cancel swap order', e)
sentry.captureException({ e, txid })
sentry.captureException(`${{ e, txid }}`)
if (isMangoError(e)) {
notify({
title: 'Transaction failed',
Expand All @@ -77,7 +77,7 @@ export const handleCancelTriggerOrder = async (
}
}
} catch (e) {
sentry.captureException({ e })
sentry.captureException(`${{ e }}`)
console.error('failed to cancel trigger order', e)
} finally {
if (setCancelId) {
Expand Down Expand Up @@ -112,7 +112,7 @@ export const handleCancelAll = async (
await actions.reloadMangoAccount(slot)
} catch (e) {
console.error('failed to cancel trigger orders', e)
sentry.captureException({ e, txid })
sentry.captureException(`${{ e, txid }}`)
if (isMangoError(e)) {
notify({
title: 'Transaction failed',
Expand All @@ -124,7 +124,7 @@ export const handleCancelAll = async (
}
}
} catch (e) {
sentry.captureException({ e })
sentry.captureException(`${{ e }}`)
console.error('failed to cancel swap order', e)
} finally {
setCancelId('')
Expand Down
2 changes: 1 addition & 1 deletion components/trade/AdvancedTradeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ const AdvancedTradeForm = () => {
}
} catch (e) {
console.error('Place trade error:', e)
sentry.captureException({ e, txid })
sentry.captureException(`${{ e, txid }}`)
if (!isMangoError(e)) return
notify({
title: 'There was an issue.',
Expand Down
2 changes: 1 addition & 1 deletion components/trade/SpotMarketOrderSwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export default function SpotMarketOrderSwapForm() {
})
} catch (e) {
console.error('onSwap error: ', e)
sentry.captureException({ e, txid })
sentry.captureException(`${{ e, txid }}`)
if (isMangoError(e)) {
const slippageExceeded = await parseTxForKnownErrors(
connection,
Expand Down
4 changes: 2 additions & 2 deletions utils/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ export function notify(newNotification: {
: INITIAL_SOUND_SETTINGS
if (newNotification.type === 'error' && !newNotification.noSentry) {
sentry.captureException(
{
`${{
title: newNotification.title,
description: newNotification.description,
txid: newNotification.txid,
},
}}`,
{
tags: {
origin: 'userAlert',
Expand Down
2 changes: 1 addition & 1 deletion utils/tradeForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const handlePlaceTriggerOrder = async (
await actions.reloadMangoAccount(tx?.slot)
} catch (e) {
console.error('onSwap error: ', e)
sentry.captureException(e)
sentry.captureException(`${e}`)
if (isMangoError(e)) {
notify({
title: 'Transaction failed',
Expand Down

0 comments on commit 9ebd548

Please sign in to comment.