{"record":{"id":"d1b9b9c3b0524e12","repo":"App-vNext/Polly","slug":"value-must-be-less-than-or-equal-to-one-d1b9b9","errorCode":null,"errorMessage":"Value must be less than or equal to one.","messagePattern":"Value must be less than or equal to one\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs","lineNumber":236,"sourceCode":"    public static AsyncCircuitBreakerPolicy AdvancedCircuitBreakerAsync(\n        this PolicyBuilder policyBuilder,\n        double failureThreshold,\n        TimeSpan samplingDuration,\n        int minimumThroughput,\n        TimeSpan durationOfBreak,\n        Action<Exception, CircuitState, TimeSpan, Context> onBreak,\n        Action<Context> onReset, Action onHalfOpen)\n    {\n        var resolutionOfCircuit = TimeSpan.FromTicks(AdvancedCircuitController<EmptyStruct>.ResolutionOfCircuitTimer);\n\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)","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/App-vNext/Polly/blob/d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerSyntax.cs#L218-L254","documentation":"Thrown by the async AdvancedCircuitBreaker syntax when failureThreshold exceeds 1. failureThreshold is a ratio, so >1 (>100% failures) is invalid. Fires at policy build time.","triggerScenarios":"Calling AdvancedCircuitBreakerAsync(failureThreshold: 100, ...) expecting percent semantics. The check is `failureThreshold > 1`.","commonSituations":"Passing a percentage integer (50, 100) instead of a fraction (0.5, 1.0).","solutions":["Pass a ratio in (0,1]; divide percentages by 100.","Clamp the configured value into (0,1] at startup."],"exampleFix":"// before\n.AdvancedCircuitBreakerAsync(failureThreshold: 75, ...)\n\n// after\n.AdvancedCircuitBreakerAsync(failureThreshold: 0.75, ...)","handlingStrategy":"validation","validationCode":"if (failureThreshold is <= 0 or > 1)\n    throw new ArgumentOutOfRangeException(nameof(failureThreshold), \"failureThreshold must be in (0,1].\");","typeGuard":"static bool IsValidFailureThreshold(double t) => t > 0 && t <= 1;","tryCatchPattern":null,"preventionTips":["Convert percentage config to a ratio at the binding boundary.","Add an assertion test that construction succeeds with 1.0 and fails above it.","Keep one validation helper shared across sync/async/generic overloads."],"tags":["circuit-breaker","argument-validation","legacy-api","async","configuration"],"backgroundTag":null,"analyzedSha":"d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac","analyzedAt":"2026-08-13T16:36:01.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}