Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Handle failures in optional fallback providers
When a best-effort feed falls back to another service, catch that service’s failure at the same boundary and return the documented degraded response with an error log.
Bad example
| 1 | return await backup.read(); |
Explanation (EN)
When a best-effort feed falls back to another service, catch that service’s failure at the same boundary and return the documented degraded response with an error log.
Objašnjenje (HR)
When a best-effort feed falls back to another service, catch that service’s failure at the same boundary and return the documented degraded response with an error log.
Good example
| 1 | try { return await backup.read(); } catch (error) { log(error); return { items: [] }; } |
Explanation (EN)
Handle failures in optional fallback providers
Objašnjenje (HR)
Handle failures in optional fallback providers
Notes (EN)
When a best-effort feed falls back to another service, catch that service’s failure at the same boundary and return the documented degraded response with an error log.
Bilješke (HR)
Primijeniti pri promjenama cachea, fallbacka i obrade skupova podataka.
Exceptions / Tradeoffs (EN)
Do not hide failures in transactional or integrity-critical operations.
Iznimke / Tradeoffi (HR)
Do not hide failures in transactional or integrity-critical operations.