Skip to content

Commit

Permalink
Add more logging for GoCardless rate limit information (actualbudget#…
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-fidd authored Dec 6, 2024
1 parent 1b25235 commit 3ce7ae9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/loot-core/src/server/accounts/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3895.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [matt-fidd]
---

Add more logging for GoCardless rate limit information

0 comments on commit 3ce7ae9

Please sign in to comment.