Skip to content

Commit

Permalink
fix(analytics): reporting empty error, closes #4907
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Feb 6, 2024
1 parent a6a33a0 commit ad32854
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useCallback, useState } from 'react';

import { isError } from '@shared/utils';

import { useAnalytics } from '@app/common/hooks/analytics/use-analytics';
import { delay } from '@app/common/utils';
import { useBitcoinClient } from '@app/store/common/api-clients.hooks';
Expand Down Expand Up @@ -30,7 +32,10 @@ export function useBitcoinBroadcastTransaction() {
return txid;
} catch (e) {
onError?.(e as Error);
void analytics.track('error_broadcasting_transaction', { error: e });
void analytics.track('error_broadcasting_transaction', {
errorName: isError(e) ? e.name : 'unknown',
errorMsg: isError(e) ? e.message : 'unknown',
});
return;
} finally {
setIsBroadcasting(false);
Expand Down

0 comments on commit ad32854

Please sign in to comment.