Define and implement explicit, user- and operator-facing error semantics for async/protocol code: handle recoverable/expected mismatches without panicking, make failure outcomes observable, and ensure recovery/retry behavior is bounded and well-specified.
Apply this standard
panic!/unhandled!(). Prefer return/ignore with log::warn! (including the offending parameters) and continue.Concrete examples
('n', Some(b'?')) => {
match next_param_or(0) {
996 => handler.report_color_scheme(writer),
other => {
log::warn!("Unhandled CSI ? Ps n query: {other}");
// graceful no-op
}
}
}
// On Ok(None) / Err, wait a little before re-opening the listener.
self.restart_backoff = self.restart_backoff.next();
warpui::async::sleep(self.restart_backoff).await;
self.start_dormant_claude_wake_listener(conversation_id, ctx);
Checklist: For any change touching error handling, confirm you can answer (a) what happens on failure, (b) whether it retries/reconciles, (c) how the user/client learns about it, and (d) where the error reason is captured (log/telemetry).
Enter the URL of a public GitHub repository