{"record":{"id":"ce2225a8be00d4f1","repo":"cloudflare/quiche","slug":"an-error-happened-stopping","errorCode":null,"errorMessage":"An error happened, stopping.","messagePattern":"An error happened, stopping\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"h3i/src/prompts/h3/settings.rs","lineNumber":108,"sourceCode":"                println!(\"An error happened, stopping.\");\n                break;\n            },\n        };\n\n        let ty = match ty.as_str() {\n            QPACK_MAX_TABLE_CAPACITY => 0x1,\n            MAX_FIELD_SECTION_SIZE => 0x6,\n            QPACK_BLOCKED_STREAMS => 0x7,\n            ENABLE_CONNECT_PROTOCOL => 0x8,\n            H3_DATAGRAM => 0x33,\n\n            v => v.parse::<u64>().unwrap(),\n        };\n\n        let value = Text::new(\"setting value:\")\n            .with_validator(h3::validate_varint)\n            .prompt()\n            .expect(\"An error happened, stopping.\")\n            .parse::<u64>()\n            .unwrap();\n\n        settings.push((ty, value));\n    }\n\n    settings\n}\n\nfn validate_setting_type(id: &str) -> SuggestionResult<Validation> {\n    if matches!(\n        id,\n        \"q!\" | QPACK_MAX_TABLE_CAPACITY |\n            MAX_FIELD_SECTION_SIZE |\n            QPACK_BLOCKED_STREAMS |\n            ENABLE_CONNECT_PROTOCOL |\n            H3_DATAGRAM\n    ) {","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/h3i/src/prompts/h3/settings.rs#L90-L126","documentation":"In settings_read_loop of h3i's interactive settings prompt, each 'setting value:' Text prompt is unwrapped with expect('An error happened, stopping.'), panicking when inquire fails. This happens when the user cancels the prompt or stdin is not interactive.","triggerScenarios":"Pressing ESC/Ctrl-C while entering a setting value in the settings prompt loop; running the interactive prompt in a non-TTY context.","commonSituations":"Piping commands into h3i; aborting the settings entry mid-loop; containers without -t.","solutions":["Enter a value (validated as a varint u64) instead of cancelling.","Use the prompt's cancel/skip path intended by the loop rather than ESC mid-entry.","Propagate the InquireError with ? and break the loop gracefully."],"exampleFix":"// before\n.prompt().expect(\"An error happened, stopping.\").parse::<u64>().unwrap();\n// after\n.prompt()? .parse::<u64>().map_err(|_| inquire::InquireError::OperationCanceled)?;","handlingStrategy":"try-catch","validationCode":"if !atty::is(atty::Stream::Stdin) {\n    eprintln!(\"settings prompt requires a TTY\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"let value = Text::new(\"setting value:\")\n    .with_validator(h3::validate_varint)\n    .prompt()?;","preventionTips":["Complete each prompt without cancelling unless you intend to abort the flow.","Provide settings via config/action files when automating.","Propagate InquireError instead of panicking in the loop."],"tags":["cli","interactive-prompt","inquire","panic"],"backgroundTag":"user-aborted-prompt","analyzedSha":"9f96daa2c22a4468b0036fb0a0a3894eee6498b8","analyzedAt":"2026-09-08T11:27:09.536Z","contentChangedAt":"2026-09-08T11:27:09.536Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}