{"record":{"id":"e5e5ccb921399df0","repo":"nautechsystems/nautilus_trader","slug":"unsupported-bitmextimeinforce-value","errorCode":null,"errorMessage":"Unsupported BitmexTimeInForce: {value}","messagePattern":"Unsupported BitmexTimeInForce: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/bitmex/src/common/enums.rs","lineNumber":328,"sourceCode":"    GoodTillDate,\n    AtTheClose,\n    GoodThroughCrossing,\n    AtCrossing,\n}\n\nimpl TryFrom<BitmexTimeInForce> for TimeInForce {\n    type Error = anyhow::Error;\n\n    fn try_from(value: BitmexTimeInForce) -> Result<Self, Self::Error> {\n        match value {\n            BitmexTimeInForce::Day => Ok(Self::Day),\n            BitmexTimeInForce::GoodTillCancel => Ok(Self::Gtc),\n            BitmexTimeInForce::GoodTillDate => Ok(Self::Gtd),\n            BitmexTimeInForce::ImmediateOrCancel => Ok(Self::Ioc),\n            BitmexTimeInForce::FillOrKill => Ok(Self::Fok),\n            BitmexTimeInForce::AtTheOpening => Ok(Self::AtTheOpen),\n            BitmexTimeInForce::AtTheClose => Ok(Self::AtTheClose),\n            _ => anyhow::bail!(\"Unsupported BitmexTimeInForce: {value}\"),\n        }\n    }\n}\n\nimpl TryFrom<TimeInForce> for BitmexTimeInForce {\n    type Error = anyhow::Error;\n\n    fn try_from(value: TimeInForce) -> Result<Self, Self::Error> {\n        match value {\n            TimeInForce::Day => Ok(Self::Day),\n            TimeInForce::Gtc => Ok(Self::GoodTillCancel),\n            TimeInForce::Gtd => Ok(Self::GoodTillDate),\n            TimeInForce::Ioc => Ok(Self::ImmediateOrCancel),\n            TimeInForce::Fok => Ok(Self::FillOrKill),\n            TimeInForce::AtTheOpen => Ok(Self::AtTheOpening),\n            TimeInForce::AtTheClose => Ok(Self::AtTheClose),\n        }\n    }","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bitmex/src/common/enums.rs#L310-L346","documentation":"TryFrom<BitmexTimeInForce> (to Nautilus TimeInForce) falls back to a catch-all bail for BitMEX time-in-force variants that have no Nautilus mapping. Any BitmexTimeInForce outside Gtc/Gtd/Ioc/Fok/AtTheOpen/AtTheClose produces this error.","triggerScenarios":"Converting a BitMEX time-in-force value from inbound exchange data (e.g. execution reports) whose variant is not covered by the explicit match arms.","commonSituations":"BitMEX adds or emits a new/less common TIF variant (e.g. grouped or peg-related TIFs) that the adapter version does not map; deserializing historical or new exchange payloads with a stale adapter.","solutions":["Upgrade the nautilus_bitmex adapter to a version that maps the new BitmexTimeInForce variant","Check the exact `value` in the message and handle that variant upstream before conversion","Patch the match in common/enums.rs to add the missing BitmexTimeInForce -> TimeInForce mapping"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn is_mapped_bitmex_tif(t: BitmexTimeInForce) -> bool {\n    matches!(t, Gtc | Gtd | Ioc | Fok | AtTheOpen | AtTheClose)\n}","tryCatchPattern":"match BitmexTimeInForce::try_from(raw_tif) {\n    Ok(v) => v,\n    Err(e) => { log::warn!(\"unknown BitMEX TIF: {e}\"); BitmexTimeInForce::GoodTillCancel }\n}","preventionTips":["Keep the adapter updated when BitMEX adds TIF variants","Log and skip unmapped inbound TIF values instead of failing the stream"],"tags":["bitmex","time-in-force","enum-conversion"],"backgroundTag":"unsupported-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"}