{"record":{"id":"2133e779bea44324","repo":"bevyengine/bevy","slug":"invalid-threshold-0-expected-0-0-threshold","errorCode":null,"errorMessage":"invalid threshold {0}, expected 0.0 <= threshold <= 2.0","messagePattern":"invalid threshold (.+?), expected 0\\.0 <= threshold <= 2\\.0","errorType":"validation","errorClass":"AxisSettingsError","httpStatus":null,"severity":"error","filePath":"crates/bevy_input/src/gamepad.rs","lineNumber":317,"sourceCode":"    LiveZoneUpperBoundOutOfRange(f32),\n    /// Parameter `livezone_lowerbound` was not less than or equal to parameter `deadzone_lowerbound`.\n    #[error(\"invalid parameter values livezone_lowerbound {} deadzone_lowerbound {}, expected livezone_lowerbound <= deadzone_lowerbound\", livezone_lowerbound, deadzone_lowerbound)]\n    LiveZoneLowerBoundGreaterThanDeadZoneLowerBound {\n        /// The value of the `livezone_lowerbound` parameter.\n        livezone_lowerbound: f32,\n        /// The value of the `deadzone_lowerbound` parameter.\n        deadzone_lowerbound: f32,\n    },\n    ///  Parameter `deadzone_upperbound` was not less than or equal to parameter `livezone_upperbound`.\n    #[error(\"invalid parameter values livezone_upperbound {} deadzone_upperbound {}, expected deadzone_upperbound <= livezone_upperbound\", livezone_upperbound, deadzone_upperbound)]\n    DeadZoneUpperBoundGreaterThanLiveZoneUpperBound {\n        /// The value of the `livezone_upperbound` parameter.\n        livezone_upperbound: f32,\n        /// The value of the `deadzone_upperbound` parameter.\n        deadzone_upperbound: f32,\n    },\n    /// The given parameter was not in range 0.0..=2.0.\n    #[error(\"invalid threshold {0}, expected 0.0 <= threshold <= 2.0\")]\n    Threshold(f32),\n}\n\n/// Errors that occur when setting button settings for gamepad input.\n#[derive(Error, Debug, PartialEq)]\npub enum ButtonSettingsError {\n    /// The given parameter was not in range 0.0..=1.0.\n    #[error(\"invalid release_threshold {0}, expected value [0.0..=1.0]\")]\n    ReleaseThresholdOutOfRange(f32),\n    /// The given parameter was not in range 0.0..=1.0.\n    #[error(\"invalid press_threshold {0}, expected [0.0..=1.0]\")]\n    PressThresholdOutOfRange(f32),\n    /// Parameter `release_threshold` was not less than or equal to `press_threshold`.\n    #[error(\"invalid parameter values release_threshold {} press_threshold {}, expected release_threshold <= press_threshold\", release_threshold, press_threshold)]\n    ReleaseThresholdGreaterThanPressThreshold {\n        /// The value of the `press_threshold` parameter.\n        press_threshold: f32,\n        /// The value of the `release_threshold` parameter.","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_input/src/gamepad.rs#L299-L335","documentation":"AxisSettingsError::Threshold — the axis threshold (raw value at which button-like pressed/release events are emitted) was set outside the valid 0.0..=2.0 range. The offending value is the payload; choose a threshold within range.","triggerScenarios":"Thrown at crates/bevy_input/src/gamepad.rs:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Clamp the threshold to [0.0, 2.0]","Validate user-provided thresholds before constructing the settings"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}