{"record":{"id":"e3435d8fc2bac8e2","repo":"nautechsystems/nautilus_trader","slug":"failed-e","errorCode":null,"errorMessage":"{FAILED}: {e}","messagePattern":"\\{FAILED\\}: \\{e\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/model/src/events/order/initialized.rs","lineNumber":317,"sourceCode":"            trigger_price,\n            trigger_type,\n            limit_offset,\n            trailing_offset,\n            trailing_offset_type,\n            expire_time,\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        )\n        .unwrap_or_else(|e| panic!(\"{FAILED}: {e}\"))\n    }\n}\n\nimpl Debug for OrderInitialized {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(\n            f,\n            \"{}(\\\n            trader_id={}, \\\n            strategy_id={}, \\\n            instrument_id={}, \\\n            client_order_id={}, \\\n            side={}, \\\n            type={}, \\\n            quantity={}, \\\n            time_in_force={}, \\\n            post_only={}, \\\n            reduce_only={}, \\","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/model/src/events/order/initialized.rs#L299-L335","documentation":"OrderInitialized::new panics with a {FAILED}: {e} message when the underlying fallible constructor returns an error (e.g. invalid instrument ID, trader/account ID format, or other model validation failure). The public API trades a Result for a panic, surfacing the inner error text after the FAILED prefix.","triggerScenarios":"Calling OrderInitialized::new with malformed IDs (invalid InstrumentId, AccountId, StrategyId, UUID4, etc.) or parameters that fail the inner model validation, causing unwrap_or_else to panic.","commonSituations":"Config files with mistyped instrument or strategy identifiers; programmatically generated IDs missing expected separators; deserializing orders from a feed with different ID conventions.","solutions":["Validate all IDs (InstrumentId, AccountId, StrategyId, ExecAlgorithmId) with their TryFrom/parse before calling new","Correct the malformed identifier in your configuration or event source","If you cannot panic, build via the fallible inner constructor path in your own wrapper"],"exampleFix":"// before\nlet event = OrderInitialized::new(..., instrument_id, ...); // panics on bad ID\n// after\nlet instrument_id = InstrumentId::from_str(\"BTCUSDT.BINANCE\")?;\nlet event = OrderInitialized::new(..., instrument_id, ...);","handlingStrategy":"validation","validationCode":"// Validate identifiers before constructing the event\nfn id_ok(s: &str) -> bool {\n    InstrumentId::from_str(s).is_ok()\n        && AccountId::from_str(&acct).is_ok()\n        && StrategyId::from_str(&strategy).is_ok()\n}","typeGuard":null,"tryCatchPattern":"// Wrap construction if panics are unacceptable\nlet event = std::panic::catch_unwind(|| OrderInitialized::new(...))\n    .map_err(|_| anyhow::anyhow!(\"OrderInitialized construction failed\"))?;","preventionTips":["Parse all IDs with their TryFrom impls at config-load time","Centralize order event construction in one validated code path","Log the raw identifiers when construction fails to speed diagnosis"],"tags":["rust","panic","order-events","invalid-identifier","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"}