Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Don't console.error an error already surfaced in the UI
Avoid duplicate console errors while preserving required production diagnostics; visible UI does not replace telemetry.
Bad example
| 1 | catch (error) { |
| 2 | console.error(error); |
| 3 | setErrorMessage(String(error)); // already shown in UI |
| 4 | } |
Explanation (EN)
An unstructured console log can duplicate the established reporting path and expose raw error data.
Objašnjenje (HR)
Good example
| 1 | catch (error) { |
| 2 | reportFailure(error); |
| 3 | setErrorMessage("The operation could not be completed."); |
| 4 | } |
Explanation (EN)
The shared reporter owns safe diagnostic details, while the user receives an appropriate message.
Objašnjenje (HR)
Notes (EN)
Assign one owner for diagnostic reporting and one for user-facing feedback, avoiding duplicate logs for the same handled incident.
Exceptions / Tradeoffs (EN)
An error shown in UI is not production telemetry. Keep required operational reporting, redact sensitive fields and use configured development logging instead of hostname heuristics.