{"record":{"id":"3dde053701f92911","repo":"nautechsystems/nautilus_trader","slug":"failed-e-3dde05","errorCode":null,"errorMessage":"{FAILED}: {e}","messagePattern":"\\{FAILED\\}: \\{e\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/model/src/orders/limit_if_touched.rs","lineNumber":245,"sourceCode":"            expire_time,\n            post_only,\n            reduce_only,\n            quote_quantity,\n            display_qty,\n            emulation_trigger,\n            trigger_instrument_id,\n            contingency_type,\n            order_list_id,\n            linked_order_ids,\n            parent_order_id,\n            exec_algorithm_id,\n            exec_algorithm_params,\n            exec_spawn_id,\n            tags,\n            init_id,\n            ts_init,\n        )\n        .unwrap_or_else(|e| panic!(\"{FAILED}: {e}\"))\n    }\n}\n\nimpl PartialEq for LimitIfTouchedOrder {\n    fn eq(&self, other: &Self) -> bool {\n        self.client_order_id == other.client_order_id\n    }\n}\n\nimpl Deref for LimitIfTouchedOrder {\n    type Target = OrderCore;\n\n    fn deref(&self) -> &Self::Target {\n        &self.core\n    }\n}\n\nimpl DerefMut for LimitIfTouchedOrder {","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/model/src/orders/limit_if_touched.rs#L227-L263","documentation":"LimitIfTouchedOrder::new panics with `Condition failed: {e}` when LimitIfTouchedOrder::new_checked returns an OrderError; the `new` wrapper converts the Err to a panic. Checks include check_positive_quantity, check_display_qty, check_time_in_force and the OrderInitialized::new_checked invariants. `FAILED` is `\"Condition failed\"` from crates/core/src/correctness.rs.","triggerScenarios":"Calling LimitIfTouchedOrder::new (crates/model/src/orders/limit_if_touched.rs) with a non-positive quantity, display_qty exceeding quantity, GTD without a valid expire_time, or an invalid init-event invariant (e.g. NoOrderSide, invalid contingency type combination).","commonSituations":"Strategy configs that leave quantity at a zero default; iceberg display_qty above total quantity; GTD orders created after dropping an expire_time field; programmatically derived sides defaulting to NoOrderSide.","solutions":["Inspect the `{e}` OrderError message for the specific failed check.","Switch to LimitIfTouchedOrder::new_checked and handle the Result.","Correct inputs: positive quantity, display_qty <= quantity, expire_time for GTD, valid side.","Validate values from config/IPC before constructing the order."],"exampleFix":"// before\nlet order = LimitIfTouchedOrder::new(..., Some(display_qty_gt_total), ...); // panics\n// after\nlet order = LimitIfTouchedOrder::new_checked(..., Some(display_qty.min(quantity)), ...)?;","handlingStrategy":"validation","validationCode":"fn valid_lit_args(qty: Quantity, display_qty: Option<Quantity>, tif: TimeInForce, expire_time: Option<UnixNanos>) -> Result<(), String> {\n    if qty.raw == 0 { return Err(\"quantity must be positive\".into()); }\n    if let Some(dq) = display_qty { if dq > qty { return Err(\"display_qty exceeds quantity\".into()); } }\n    if tif == TimeInForce::Gtd && expire_time.map_or(true, |t| t.as_u64() == 0) { return Err(\"GTD requires expire_time\".into()); }\n    Ok(())\n}","typeGuard":"if qty.is_zero() || side == OrderSide::NoOrderSide { return None; }","tryCatchPattern":null,"preventionTips":["Use new_checked when inputs are not statically guaranteed valid","Always pair GTD with expire_time","Cap display_qty at quantity","Test constructor failure paths"],"tags":["rust","orders","panic","constructor","validation"],"backgroundTag":"invalid-constructor-argument","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}