Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
console.log(`response`, response);
throw new Error(
`Fetch error:${JSON.stringify({
request,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dynamic data in error messages has been difficult to work with in the past. It makes it easy to accidentally introduce PII, and it's bad for error grouping on Sentry (each unique message pops up as a separate issue). I'd strongly recommend looking for another solution.

If there is a particular network request / failure case you want more information about, I'd recommend catching there instead and capturing a more detailed exception. This fetch function is used in a variety of places

status: response.status,
...mapKeysToCamel(json),
})}`,
Expand Down Expand Up @@ -335,8 +336,8 @@
status: TransactionStatus.failed,
error: {
name: 'SmartTransactionFailed',
message: `Smart transaction failed with status: ${status}`,

Check warning on line 339 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Invalid type "string | undefined" of template literal expression

Check warning on line 339 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Invalid type "string | undefined" of template literal expression
},
};
updateTransaction(updatedTransaction, `Smart transaction status: ${status}`);

Check warning on line 342 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (18.x)

Invalid type "string | undefined" of template literal expression

Check warning on line 342 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Build, lint, and test / Lint (20.x)

Invalid type "string | undefined" of template literal expression
};
Loading