A local-first personal finance app
Add more logging for GoCardless rate limit information (#3895)
Matt Fiddaman3ce7ae91d920
diff --git a/packages/loot-core/src/server/accounts/sync.ts b/packages/loot-core/src/server/accounts/sync.tsindex adf9a2fdfc..aedf1e4f80 100644--- a/packages/loot-core/src/server/accounts/sync.ts+++ b/packages/loot-core/src/server/accounts/sync.ts@@ -32,8 +32,8 @@ import { title } from './title';import { runRules } from './transaction-rules';import { batchUpdateTransactions } from './transactions';-function BankSyncError(type: string, code: string) {- return { type: 'BankSyncError', category: type, code };+function BankSyncError(type: string, code: string, details?: object) {+ return { type: 'BankSyncError', category: type, code, details };}function makeSplitTransaction(trans, subtransactions) {@@ -152,7 +152,11 @@ async function downloadGoCardlessTransactions();if (res.error_code) {- throw BankSyncError(res.error_type, res.error_code);+ const errorDetails = {+ rateLimitHeaders: res.rateLimitHeaders,+ };++ throw BankSyncError(res.error_type, res.error_code, errorDetails);}if (includeBalance) {diff --git a/upcoming-release-notes/3895.md b/upcoming-release-notes/3895.mdnew file mode 100644index 0000000000..91e2afe471--- /dev/null+++ b/upcoming-release-notes/3895.md@@ -0,0 +1,6 @@+---+category: Enhancements+authors: [matt-fidd]+---++Add more logging for GoCardless rate limit information