{"record":{"id":"eac5cf8bf84e6eeb","repo":"nautechsystems/nautilus_trader","slug":"invalid-statusmsg-reason-was-invalid","errorCode":null,"errorMessage":"Invalid `StatusMsg` reason, was '{invalid}'","messagePattern":"Invalid `StatusMsg` reason, was '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/databento/src/decode/primitives.rs","lineNumber":198,"sourceCode":"        30 => \"News pending\",\n        31 => \"News released\",\n        32 => \"News and resumption times\",\n        33 => \"News not forthcoming\",\n        40 => \"Order imbalance\",\n        50 => \"LULD pause\",\n        60 => \"Operational\",\n        70 => \"Additional information requested\",\n        80 => \"Merger effective\",\n        90 => \"ETF\",\n        100 => \"Corporate action\",\n        110 => \"New Security offering\",\n        120 => \"Market wide halt level 1\",\n        121 => \"Market wide halt level 2\",\n        122 => \"Market wide halt level 3\",\n        123 => \"Market wide halt carryover\",\n        124 => \"Market wide halt resumption\",\n        130 => \"Quotation not available\",\n        invalid => anyhow::bail!(\"Invalid `StatusMsg` reason, was '{invalid}'\"),\n    };\n\n    Ok(Some(Ustr::from(value_str)))\n}\n\n/// Parses a Databento status trading event code into a human-readable string.\n///\n/// # Errors\n///\n/// Returns an error if `value` is an invalid status trading event code.\npub fn parse_status_trading_event(value: u16) -> anyhow::Result<Option<Ustr>> {\n    let value_str = match value {\n        0 => return Ok(None),\n        1 => \"No cancel\",\n        2 => \"Change trading session\",\n        3 => \"Implied matching on\",\n        4 => \"Implied matching off\",\n        _ => anyhow::bail!(\"Invalid `StatusMsg` trading_event, was '{value}'\"),","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/databento/src/decode/primitives.rs#L180-L216","documentation":"`parse_status_reason` maps Databento status reason codes (e.g. 120-124 market-wide halts, 130 quotation not available) to human-readable strings. A reason code outside the mapped table has no known meaning, so the parser bails rather than emitting a wrong label.","triggerScenarios":"Decoding a `StatusMsg` whose `reason` code is not in the lookup table (codes like 1..130 that the adapter maps, or new codes Databento introduced).","commonSituations":"Exchange adding new halt reasons; newer dbn crate producing codes the adapter table predates; receiving status records from datasets/exchanges with unmapped codes.","solutions":["Upgrade the adapter crate to get the latest reason-code table","Check the Databento status code documentation for the numeric value","If the code is legitimately new, filter or pass through status records without reason decoding until support lands","Report the unmapped code to adapter maintainers"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match decode_status_msg(msg) {\n    Ok(status) => status,\n    Err(e) if e.to_string().contains(\"Invalid `StatusMsg` reason\") => {\n        log::warn!(\"unmapped status reason code; skipping reason decode\");\n        None\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep the adapter crate updated for new reason codes","Log the raw numeric code when decoding fails to aid lookup","Consult Databento's status-code docs when handling unfamiliar codes","Treat status-record decode errors as non-fatal and skip the record"],"tags":["rust","databento","status","enum"],"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"}