actualbudget/actual · error
results.reason || results.error
Error message
results.reason || results.error
What it means
Companion guard to the error_code check: if the 'simplefin-accounts' response contains an 'error' field (generic server/provider error without a structured code), it is thrown as an Error using results.reason or results.error as the message.
Source
Thrown at packages/desktop-client/src/components/banksync/useBuiltInBankSyncProviders.ts:414
}
if (loadingSimpleFinAccounts) {
return;
}
setLoadingSimpleFinAccounts(true);
try {
const results = await send('simplefin-accounts');
if (results.error_code === 'INVALID_ACCESS_TOKEN') {
onSimpleFinInit();
return;
}
if (results.error_code) {
throw new Error(results.reason || results.error_code);
}
if ('error' in results && results.error) {
throw new Error(results.reason || results.error);
}
const externalAccounts: SyncServerSimpleFinAccount[] = (
(results.accounts ?? []) as SimpleFinAccount[]
).map(oldAccount => ({
account_id: oldAccount.id,
name: oldAccount.name,
institution: oldAccount.org.name,
orgDomain: oldAccount.org.domain,
orgId: oldAccount.org.id,
balance: oldAccount.balance,
}));
dispatch(
pushModal({
modal: {
name: 'select-linked-accounts',
options: {View on GitHub (pinned to d4334cb6e6)
Solutions
- Inspect the thrown message (results.reason || results.error) and the sync-server logs for the underlying HTTP failure
- Retry the fetch after confirming the SimpleFin bridge is reachable from the sync server
- Verify SIMPLEFIN_BASE_URL points at a valid bridge endpoint
- Update Actual/sync-server if the provider API contract changed
Defensive patterns
Strategy: try-catch
Validate before calling
const res = await send('simplefin-accounts');
if (('error' in res && res.error) || res.error_code) {
throw new Error(res.reason || (res as { error?: string }).error || res.error_code);
} Type guard
const hasProviderError = (r: object): r is { reason?: string; error: string } =>
'error' in r && typeof (r as { error?: unknown }).error === 'string' && r.error !== ''; Try / catch
try {
await loadSimpleFinAccounts();
} catch (e) {
logger.error('SimpleFin error', e);
notify('SimpleFin fetch failed; check sync-server logs.');
} Prevention
- Monitor sync-server connectivity to the SimpleFin bridge
- Retry transient failures with backoff
- Keep the SIMPLEFIN_BASE_URL configuration validated
When it happens
Trigger: The 'simplefin-accounts' IPC returns an object with error_code falsy but { error: '...' } present — typically an unstructured failure on the sync server when proxying SimpleFin (HTTP error body, exception message, etc.).
Common situations: SimpleFin bridge returning 5xx pages that get surfaced as an error string; sync-server misconfiguration; transient network failure between the server and SimpleFin.
Related errors
- results.reason || results.error_code
- results.reason
- results.error
- SimpleFIN claim failed with HTTP ${response.status}
- Too many redirects
AI-assisted analysis of actualbudget/actual@d4334cb6e6 (2026-08-29).
Data as JSON: /api/errors/214bb3afb5cd4dba.
Report an issue: GitHub.