{"record":{"id":"607945fc809f1554","repo":"sigoden/aichat","slug":"aborted","errorCode":null,"errorMessage":"Aborted.","messagePattern":"Aborted\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/client/common.rs","lineNumber":455,"sourceCode":"        Err(err) => Err(err),\n    }\n}\n\npub async fn call_chat_completions_streaming(\n    input: &Input,\n    client: &dyn Client,\n    abort_signal: AbortSignal,\n) -> Result<(String, Vec<ToolResult>)> {\n    let (tx, rx) = unbounded_channel();\n    let mut handler = SseHandler::new(tx, abort_signal.clone());\n\n    let (send_ret, render_ret) = tokio::join!(\n        client.chat_completions_streaming(input, &mut handler),\n        render_stream(rx, client.global_config(), abort_signal.clone()),\n    );\n\n    if handler.abort().aborted() {\n        bail!(\"Aborted.\");\n    }\n\n    render_ret?;\n\n    let (text, tool_calls) = handler.take();\n    match send_ret {\n        Ok(_) => {\n            if !text.is_empty() && !text.ends_with('\\n') {\n                println!();\n            }\n            Ok((text, eval_tool_calls(client.global_config(), tool_calls)?))\n        }\n        Err(err) => {\n            if !text.is_empty() {\n                println!();\n            }\n            Err(err)\n        }","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/sigoden/aichat/blob/82976d349ad97ac9aae0655ad631dace5e2a6385/src/client/common.rs#L437-L473","documentation":"Sentinel error signaling that the SSE stream was cancelled through the shared AbortSignal (user pressed Ctrl-C or ESC) while the model response was still streaming. The handler's abort flag is checked after the send/render join completes, so this fires only for intentional user-initiated cancellation, not network or protocol failures.","triggerScenarios":"Thrown at src/client/common.rs:455 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Propagate the abort to the caller so the session returns to the prompt without retrying the request","If a partial response was already rendered before the abort, keep it in the session history so the conversation state stays consistent","Optionally offer a 'continue' command that re-issues the request with the accumulated partial output as context"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82976d349ad97ac9aae0655ad631dace5e2a6385","analyzedAt":"2026-09-09T18:33:06.139Z","contentChangedAt":"2026-09-09T18:33:06.139Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}