From 2711584f7325ec71ca44400b41f8278ed2a0b1de Mon Sep 17 00:00:00 2001 From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Sun, 21 Jun 2026 21:48:24 +0100 Subject: [PATCH] Add section on error reporting to coding guidelines --- docs/DeveloperResources/SquidCodingGuidelines.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/DeveloperResources/SquidCodingGuidelines.md b/docs/DeveloperResources/SquidCodingGuidelines.md index d217c2e9..364d2dfc 100644 --- a/docs/DeveloperResources/SquidCodingGuidelines.md +++ b/docs/DeveloperResources/SquidCodingGuidelines.md @@ -324,6 +324,12 @@ components at build time. * MUST be used inside .h to wrap relevant code. +## Error reporting + +To report an error and abort the current transaction, throw a `TextException("descriptive text", Here())`. +Use `Assure(condition)` to test an invariant and abort the current transaction. +To check system-leve invariants, where a failure needs to terminate Squid, use `xassert(condition)` + ## See Also * [DeveloperResources](/DeveloperResources).