Skip to content

Commit

Permalink
add more info to error/analytics calls
Browse files Browse the repository at this point in the history
  • Loading branch information
JFrankfurt committed Sep 18, 2024
1 parent 61ee8ae commit 7c21622
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function FramesProvider({ children }: FramesProviderProps) {
const [frameInteractionError, setFrameInteractionError] = useState('');

const onTransaction: OnTransactionFunc = useCallback(
async ({ transactionData }) => {
async ({ transactionData, frame }) => {
if (!address) {
openConnectModal?.();
return null;
Expand All @@ -131,7 +131,7 @@ export function FramesProvider({ children }: FramesProviderProps) {
value: BigInt(params.value ?? 0),
});
logEventWithContext('basename_profile_frame_transacted', ActionType.process, {
context: `value: ${params.value}`,
context: frame.postUrl ?? frame.title,
});
return transactionId;
} catch (error) {
Expand All @@ -145,7 +145,7 @@ export function FramesProvider({ children }: FramesProviderProps) {
setFrameInteractionError('Error sending transaction');
}

logError(error, 'failed to complete a frame transaction');
logError(error, `${frame.postUrl ?? frame.title} failed to complete a frame transaction`);

return null;
}
Expand All @@ -159,7 +159,7 @@ export function FramesProvider({ children }: FramesProviderProps) {
[logError],
);
const onSignature: OnSignatureFunc = useCallback(
async ({ signatureData }) => {
async ({ signatureData, frame }) => {
if (!address) {
openConnectModal?.();
return null;
Expand Down Expand Up @@ -187,7 +187,7 @@ export function FramesProvider({ children }: FramesProviderProps) {
setFrameInteractionError('Error signing data');
}

logError(error, 'failed to sign frame data');
logError(error, `${frame.postUrl ?? frame.title} failed to sign frame data`);

return null;
}
Expand Down

0 comments on commit 7c21622

Please sign in to comment.