{"record":{"id":"6f3f4c98d8d69b3f","repo":"nautechsystems/nautilus_trader","slug":"failed-e-6f3f4c","errorCode":null,"errorMessage":"{FAILED}: {e}","messagePattern":"\\{FAILED\\}: \\{e\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/model/src/orders/stop_limit.rs","lineNumber":226,"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 Deref for StopLimitOrder {\n    type Target = OrderCore;\n    fn deref(&self) -> &Self::Target {\n        &self.core\n    }\n}\n\nimpl DerefMut for StopLimitOrder {\n    fn deref_mut(&mut self) -> &mut Self::Target {\n        &mut self.core\n    }\n}\n\nimpl PartialEq for StopLimitOrder {\n    fn eq(&self, other: &Self) -> bool {","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/model/src/orders/stop_limit.rs#L208-L244","documentation":"StopLimitOrder::new panics with `Condition failed: {e}` when StopLimitOrder::new_checked returns an OrderError; `new` unwraps into a panic. Checks include check_positive_quantity, check_display_qty, check_time_in_force (GTD requires expire_time) and OrderInitialized::new_checked invariants. `FAILED` is `\"Condition failed\"` from crates/core/src/correctness.rs.","triggerScenarios":"Calling StopLimitOrder::new (crates/model/src/orders/stop_limit.rs) with a non-positive quantity, display_qty exceeding quantity, GTD without a valid expire_time, or an invalid init-event invariant (NoOrderSide, bad contingency/linked_order_ids combination).","commonSituations":"GTD stop-limit orders without expire_time; display_qty misconfigured above quantity; zero quantity from defaulted config; sides lost in enum conversion when bridging from Python or serialized events.","solutions":["Inspect the OrderError message in the panic for the precise violated check.","Switch to StopLimitOrder::new_checked and handle the Result.","Fix inputs: positive quantity, display_qty <= quantity, expire_time set for GTD, valid side.","Validate values from strategy config before calling the constructor."],"exampleFix":"// before\nlet order = StopLimitOrder::new(..., TimeInForce::Gtd, None, ...); // panics\n// after\nlet order = StopLimitOrder::new_checked(..., TimeInForce::Gtd, Some(expire_unix_nanos), ...)?;","handlingStrategy":"validation","validationCode":"fn valid_sl_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":["Pair every GTD order with expire_time","Keep display_qty <= quantity","Check quantity positivity at config load","Prefer new_checked where inputs may be invalid"],"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-14T05:17:10.506Z"}