{"record":{"id":"3c13d9ac908c2590","repo":"App-vNext/Polly","slug":"value-must-be-greater-than-one-3c13d9","errorCode":null,"errorMessage":"Value must be greater than one.","messagePattern":"Value must be greater than one\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs","lineNumber":236,"sourceCode":"\n        if (failureThreshold <= 0)\n        {\n            throw new ArgumentOutOfRangeException(nameof(failureThreshold), \"Value must be greater than zero.\");\n        }\n\n        if (failureThreshold > 1)\n        {\n            throw new ArgumentOutOfRangeException(nameof(failureThreshold), \"Value must be less than or equal to one.\");\n        }\n\n        if (samplingDuration < resolutionOfCircuit)\n        {\n            throw new ArgumentOutOfRangeException(nameof(samplingDuration), $\"Value must be equal to or greater than {resolutionOfCircuit.TotalMilliseconds} milliseconds. This is the minimum resolution of the CircuitBreaker timer.\");\n        }\n\n        if (minimumThroughput <= 1)\n        {\n            throw new ArgumentOutOfRangeException(nameof(minimumThroughput), \"Value must be greater than one.\");\n        }\n\n        if (durationOfBreak < TimeSpan.Zero)\n        {\n            throw new ArgumentOutOfRangeException(nameof(durationOfBreak), \"Value must be greater than zero.\");\n        }\n\n        if (onBreak == null)\n        {\n            throw new ArgumentNullException(nameof(onBreak));\n        }\n\n        if (onReset == null)\n        {\n            throw new ArgumentNullException(nameof(onReset));\n        }\n\n        if (onHalfOpen == null)","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/App-vNext/Polly/blob/d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs#L218-L254","documentation":"Thrown by the async AdvancedCircuitBreakerAsync<T> syntax when minimumThroughput is <= 1. It must be >= 2 because it is the minimum sample count needed before the circuit can trip on a failure ratio. Fires at policy construction.","triggerScenarios":"Calling AdvancedCircuitBreakerAsync(..., minimumThroughput: 1, ...) or 0/negative. The check is `minimumThroughput <= 1`.","commonSituations":"Using 1 expecting 'trip on first failure' semantics (use the simple breaker instead), or a 0 default from config.","solutions":["Set minimumThroughput to at least 2 (commonly 10+).","For 'break after N events' semantics use CircuitBreakerAsync<T> with handledEventsAllowedBeforeBreaking.","Validate config >= 2 at startup."],"exampleFix":"// before\n.AdvancedCircuitBreakerAsync(..., minimumThroughput: 1, ...)\n\n// after\n.AdvancedCircuitBreakerAsync(..., minimumThroughput: 10, ...)","handlingStrategy":"validation","validationCode":"if (minimumThroughput <= 1)\n    throw new ArgumentOutOfRangeException(nameof(minimumThroughput), \"minimumThroughput must be >= 2.\");","typeGuard":"static bool IsValidMinimumThroughput(int n) => n >= 2;","tryCatchPattern":null,"preventionTips":["Use CircuitBreakerAsync<T> with handledEventsAllowedBeforeBreaking for 'break after N' behavior.","Set minimumThroughput relative to expected window throughput.","Validate config >= 2 at startup."],"tags":["circuit-breaker","argument-validation","legacy-api","async","generic-result","configuration"],"backgroundTag":null,"analyzedSha":"d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac","analyzedAt":"2026-08-13T16:36:01.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}