{"record":{"id":"5007ea42cd8a2b53","repo":"App-vNext/Polly","slug":"value-must-be-less-than-or-equal-to-one-5007ea","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/AsyncAdvancedCircuitBreakerTResultSyntax.cs","lineNumber":226,"sourceCode":"    /// <exception cref=\"ArgumentOutOfRangeException\">failureThreshold;Value must be less than or equal to one.</exception>\n    /// <exception cref=\"ArgumentOutOfRangeException\">samplingDuration;Value must be equal to or greater than the minimum resolution of the CircuitBreaker timer.</exception>\n    /// <exception cref=\"ArgumentOutOfRangeException\">minimumThroughput;Value must be greater than one.</exception>\n    /// <exception cref=\"ArgumentOutOfRangeException\">durationOfBreak;Value must be greater than zero.</exception>\n    /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"onBreak\"/> is <see langword=\"null\"/>.</exception>\n    /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"onReset\"/> is <see langword=\"null\"/>.</exception>\n    /// <exception cref=\"ArgumentNullException\">Thrown when <paramref name=\"onHalfOpen\"/> is <see langword=\"null\"/>.</exception>\n    public static AsyncCircuitBreakerPolicy<TResult> AdvancedCircuitBreakerAsync<TResult>(this PolicyBuilder<TResult> policyBuilder, double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action<DelegateResult<TResult>, CircuitState, TimeSpan, Context> onBreak, 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":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/App-vNext/Polly/blob/d0e46bdb1ee11ea50d0e4b6846d2633d6bc09bac/src/Polly/CircuitBreaker/AsyncAdvancedCircuitBreakerTResultSyntax.cs#L208-L244","documentation":"Thrown by the async AdvancedCircuitBreakerAsync<T> syntax when failureThreshold exceeds 1. failureThreshold is a ratio in (0,1]; values above 1 are invalid (>100% failure rate). Fires at policy build time.","triggerScenarios":"Calling AdvancedCircuitBreakerAsync(failureThreshold: 100, ...) treating the value as a percent. The check is `failureThreshold > 1`.","commonSituations":"Passing a percentage integer instead of a fraction.","solutions":["Pass a fraction in (0,1]; divide percentages by 100.","Clamp configured value to (0,1] at startup."],"exampleFix":"// before\n.AdvancedCircuitBreakerAsync(failureThreshold: 100, ...)\n\n// after\n.AdvancedCircuitBreakerAsync(failureThreshold: 1.0, ...)","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 percentages to ratios at the config-binding boundary.","Add a unit test that asserts 1.0 is the upper bound.","Document failureThreshold as a fraction in your wrapper."],"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"}