if BankSyncError is caused by rate limit. display that in toast (#5038)

* if BankSyncError is caused by rate limit. display that in toast

* ran prettier
This commit is contained in:
Stein Petter Tokvam
2025-05-21 18:08:22 +02:00
committed by GitHub
parent 83f6706020
commit 2e9a752baa
2 changed files with 16 additions and 1 deletions

View File

@@ -848,13 +848,22 @@ function handleSyncError(
if (err instanceof BankSyncError || (err as any)?.type === 'BankSyncError') {
const error = err as BankSyncError;
return {
const syncError = {
type: 'SyncError',
accountId: acct.id,
message: 'Failed syncing account “' + acct.name + '.”',
category: error.category,
code: error.code,
};
if (error.category === 'RATE_LIMIT_EXCEEDED') {
return {
...syncError,
message: `Failed syncing account ${acct.name}. Rate limit exceeded. Please try again later.`,
};
}
return syncError;
}
if (err instanceof PostError && err.reason !== 'internal') {

View File

@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [SteinTokvam]
---
Added information that sync error are caued by a rate limit if that's the case.