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).
fullstack ruleP2universalStack: JavaScript
loggingerror-handlingconsole
Log errors with console.error, not console.log
Use console.error (or console.warn) for failure paths so errors surface correctly in tooling, instead of console.log.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codets
| 1 | } catch (error) { |
| 2 | console.log('Get profile error?', error); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | } catch (error) { |
| 2 | console.error('Get profile error?', error); |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)