{"record":{"id":"8bfa93a6e994040a","repo":"nautechsystems/nautilus_trader","slug":"handle-deltas-impl-err","errorCode":null,"errorMessage":"`handle_deltas` {IMPL_ERR} `{}`","messagePattern":"`handle_deltas` (.+?) `(.+?)`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/indicators/src/indicator.rs","lineNumber":40,"sourceCode":"    orderbook::OrderBook,\n};\n\nconst IMPL_ERR: &str = \"is not implemented for\";\n\n#[allow(unused_variables)]\npub trait Indicator {\n    fn name(&self) -> String;\n\n    fn has_inputs(&self) -> bool;\n\n    fn initialized(&self) -> bool;\n\n    fn handle_delta(&mut self, delta: &OrderBookDelta) {\n        panic!(\"`handle_delta` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_deltas(&mut self, deltas: &OrderBookDeltas) {\n        panic!(\"`handle_deltas` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_depth(&mut self, depth: &OrderBookDepth10) {\n        panic!(\"`handle_depth` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    fn handle_book(&mut self, book: &OrderBook) {\n        panic!(\"`handle_book_mbo` {IMPL_ERR} `{}`\", self.name());\n    }\n\n    /// Updates the indicator with the given quote tick.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the configured price type cannot be extracted from the quote.\n    fn handle_quote(&mut self, quote: &QuoteTick) -> anyhow::Result<()> {\n        anyhow::bail!(\"`handle_quote_tick` {IMPL_ERR} `{}`\", self.name());\n    }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/indicators/src/indicator.rs#L22-L58","documentation":"Default `Indicator::handle_deltas` panics when an indicator receives a batch of `OrderBookDeltas` without overriding this method. Like the singular variant, this default body is a deliberate guard: batched delta input means the indicator must implement book-delta processing, and its absence is a wiring/implementation bug rather than a recoverable runtime condition. The message renders as \"`handle_deltas` is not implemented for `<indicator name>`\".","triggerScenarios":"Calling `handle_deltas(&OrderBookDeltas)` on an indicator impl that only overrides `handle_delta` (or neither), e.g. replaying a recorded delta batch through a quote-based indicator, or a data engine that delivers delta batches to all subscribed indicators.","commonSituations":"Backtesting/replaying historical L2 delta batches into indicators built for quotes; batch-processing pipelines that group deltas and call the plural method; custom indicator authors forgetting the plural override even though they implemented the singular one.","solutions":["Override `handle_deltas` in the indicator impl (a common pattern is iterating and delegating each delta to `handle_delta`).","If the indicator is not delta-based, stop subscribing it to OrderBookDeltas streams and feed the appropriate data type.","Default-implement the plural method yourself in a wrapper or adapter so batch input is expanded into single-delta calls."],"exampleFix":"// before\nimpl Indicator for MyIndicator { /* handle_delta only */ }\n\n// after\nimpl Indicator for MyIndicator {\n    fn handle_deltas(&mut self, deltas: &OrderBookDeltas) {\n        for delta in deltas.deltas() {\n            self.handle_delta(delta);\n        }\n    }\n}","handlingStrategy":"type-guard","validationCode":"// before replaying batches, verify capability\nif !indicator_supports_batch_deltas(&ind) { skip_or_convert(&ind, deltas); }","typeGuard":"fn handles_batch_deltas(ind: &dyn Indicator) -> bool { ind.as_any().is::<DeltaCapableMarker>() }","tryCatchPattern":"// no catch for panics; guard the call: if batch_capable(ind) { ind.handle_deltas(deltas); } else { for d in deltas.deltas() { ind.handle_delta(d); } }","preventionTips":["Prefer implementing handle_deltas by delegating to handle_delta in every delta-capable indicator.","Keep a capability registry mapping indicators to accepted data types.","Test replay pipelines against all registered indicators before production."],"tags":["rust","panic","indicators","missing-override","order-book-deltas"],"backgroundTag":"method-not-implemented","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"}