{"record":{"id":"d146e5a4fd5c3f12","repo":"nautechsystems/nautilus_trader","slug":"unknown-ib-condition-conjunction-value","errorCode":null,"errorMessage":"Unknown IB condition conjunction: {value}","messagePattern":"Unknown IB condition conjunction: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/common/enums/order.rs","lineNumber":823,"sourceCode":"            Self::Or => \"or\",\n        }\n    }\n\n    /// Returns whether this conjunction is the rust-ibapi `is_conjunction` flag.\n    #[must_use]\n    pub const fn is_conjunction(self) -> bool {\n        matches!(self, Self::And)\n    }\n}\n\nimpl FromStr for IbConditionConjunction {\n    type Err = anyhow::Error;\n\n    fn from_str(value: &str) -> Result<Self, Self::Err> {\n        match value.to_ascii_lowercase().as_str() {\n            \"and\" | \"a\" => Ok(Self::And),\n            \"or\" | \"o\" => Ok(Self::Or),\n            _ => anyhow::bail!(\"Unknown IB condition conjunction: {value}\"),\n        }\n    }\n}\n\nimpl Display for IbConditionConjunction {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        f.write_str(self.as_str())\n    }\n}\n\n/// Interactive Brokers price-condition trigger methods.\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n#[cfg_attr(\n    feature = \"python\",\n    pyo3::pyclass(\n        module = \"nautilus_trader.adapters.interactive_brokers\",\n        from_py_object,\n        rename_all = \"SCREAMING_SNAKE_CASE\"","sourceCodeStart":805,"sourceCodeEnd":841,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/common/enums/order.rs#L805-L841","documentation":"IbConditionConjunction::from_str in crates/adapters/interactive_brokers/src/common/enums/order.rs:823 parses how consecutive IB order conditions are joined (\"and\"/\"a\" or \"or\"/\"o\", case-insensitive) and bails with anyhow for any other value.","triggerScenarios":"Parsing conjunction strings like \"&&\", \"AND/OR\", \"nand\", \"both\", or full words in other languages — anything outside {and, a, or, o} after lowercasing.","commonSituations":"Serializing conditions from a strategy DSL that uses \"&&\"/\"||\"; UI-driven config storing human text like \"And then\"; typos like \"ad\" or \"orr\".","solutions":["Use \"and\"/\"a\" or \"or\"/\"o\" (case-insensitive).","Map boolean/logic operators (&&, ||) to \"and\"/\"or\" before parsing.","Trim whitespace and lowercase the input first.","Extend the match arms upstream if more conjunction spellings are needed."],"exampleFix":"// before\nlet c = \"&&\".parse::<IbConditionConjunction>()?; // bail!\n// after\nlet c = \"and\".parse::<IbConditionConjunction>()?; // Ok(And)","handlingStrategy":"validation","validationCode":"fn is_valid_conjunction(s: &str) -> bool {\n    matches!(s.trim().to_ascii_lowercase().as_str(), \"and\" | \"a\" | \"or\" | \"o\")\n}","typeGuard":"fn as_conjunction(s: &str) -> Option<IbConditionConjunction> {\n    s.trim().to_ascii_lowercase().parse::<IbConditionConjunction>().ok()\n}","tryCatchPattern":"match value.parse::<IbConditionConjunction>() {\n    Ok(c) => join_conditions(c),\n    Err(e) => log::error!(\"invalid conjunction '{value}' (expected and/a/or/o): {e}\"),\n}","preventionTips":["Translate logic operators (&&/||) to \"and\"/\"or\" at the serialization boundary.","Prefer constructing IbConditionConjunction::And/Or directly over parsing strings.","Lowercase and trim before parsing."],"tags":["rust","enum-parsing","interactive-brokers","conditional-orders"],"backgroundTag":"invalid-enum-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}