{"record":{"id":"b5b040913afc9bdd","repo":"App-vNext/Polly","slug":"value-must-be-greater-than-one-b5b040","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/AdvancedCircuitBreakerTResultSyntax.cs","lineNumber":243,"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":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/App-vNext/Polly/blob/d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac/src/Polly/CircuitBreaker/AdvancedCircuitBreakerTResultSyntax.cs#L225-L261","documentation":"Thrown by AdvancedCircuitBreaker<T> when minimumThroughput is <= 1. minimumThroughput is the minimum number of actions in the sampling window required before the circuit can trip, so it must be at least 2 to compute a meaningful failure ratio. Fires at policy construction.","triggerScenarios":"Calling AdvancedCircuitBreaker(..., minimumThroughput: 1, ...) or 0 or a negative value. The check is `minimumThroughput <= 1`.","commonSituations":"Setting minimumThroughput to 1 thinking it means 'break on first failure' (use the simple CircuitBreaker for that), or defaulting it to 0 from missing config.","solutions":["Set minimumThroughput to at least 2 (commonly 10+ for real traffic).","If you want 'break after N exceptions', use the simple CircuitBreaker syntax with exceptionsAllowedBeforeBreaking instead.","Validate the config value is >= 2 at startup."],"exampleFix":"// before\n.AdvancedCircuitBreaker(\n    ...,\n    minimumThroughput: 1,\n    ...)\n\n// after\n.AdvancedCircuitBreaker(\n    ...,\n    minimumThroughput: 10,\n    ...)","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":["Choose minimumThroughput based on expected throughput per sampling window.","If you need 'break after N failures' semantics, use the simple CircuitBreaker instead.","Validate the config integer is >= 2 at startup."],"tags":["circuit-breaker","argument-validation","legacy-api","configuration"],"backgroundTag":null,"analyzedSha":"d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac","analyzedAt":"2026-08-13T16:36:01.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}