mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
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:
committed by
GitHub
parent
83f6706020
commit
2e9a752baa
@@ -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') {
|
||||
|
||||
6
upcoming-release-notes/5038.md
Normal file
6
upcoming-release-notes/5038.md
Normal 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.
|
||||
Reference in New Issue
Block a user