Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP1stack specificStack: node
asyncerror-handlingpromises
Keep async/await so errors propagate from the framework correctly
Do not strip await from a returned promise if doing so changes how the framework surfaces or wraps the error.
PR: vinify-backend · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | handle() { |
| 2 | return this.service.run(); // error context may be lost |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | async handle() { |
| 2 | return await this.service.run(); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)