Uncaught Exception Path
Fires when throw new is added without a corresponding Assert.Throws or Should().Throw assertion in the test suite.
Why this rule exists
An exception added without a test is a contract change with no safety net. Callers that relied on the old behavior break silently; future refactors cannot tell whether the throw is intentional.
Code example
+ if (amount < 0) throw new ArgumentOutOfRangeException(nameof(amount));
// no test added+ if (amount < 0) throw new ArgumentOutOfRangeException(nameof(amount));
+ // tests/PaymentTests.cs
+ [Fact] public void Charge_NegativeAmount_Throws() =>
+ Assert.Throws<ArgumentOutOfRangeException>(() => svc.Charge(-1));Configuration
Disable or adjust the severity of this rule in .gauntletci.json:
{
"rules": {
"GCI0032": { "enabled": true, "severity": "Warn" }
}
}See Configuration for the full schema.
Related rules
Error Handling Integrity
Detects swallowed exceptions (empty catch blocks) and exception handling patterns that hide failures from callers and operators.
Test Quality Gaps
Detects low-quality test patterns: silenced tests ([Ignore]/[Skip]), uninformative method names, and test methods missing any assertions.
Discussed in
Why Tests Miss Bugs
Tests pass but bugs still reach production. The categories of risk that escape test suites and why a green build is not the same as safe code.
What Is Pull Request Risk Analysis?
Pull request risk analysis evaluates how a diff changes behavior, contracts, tests, runtime safety, and production blast radius before merge.
Implemented in src/GauntletCI.Core/Rules/Implementations/GCI0032_*.cs.
Eric Cogen -- Founder, GauntletCI
Twenty years as a senior technical consultant building and modernizing enterprise platforms across .NET, AWS, serverless, microservices, and AI-driven systems.
