{"record":{"id":"41c992ef32ea1d24","repo":"cloudflare/quiche","slug":"invalidinput","errorCode":"InvalidInput","errorMessage":"Must provide a <host:port> to connect","messagePattern":"Must provide a <host:port> to connect","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"h3i/src/config.rs","lineNumber":177,"sourceCode":"    }\n\n    pub fn with_dgram_recv_queue_len(\n        mut self, dgram_recv_queue_len: usize,\n    ) -> Self {\n        self.dgram_recv_queue_len = dgram_recv_queue_len;\n        self\n    }\n\n    pub fn with_dgram_send_queue_len(\n        mut self, dgram_send_queue_len: usize,\n    ) -> Self {\n        self.dgram_send_queue_len = dgram_send_queue_len;\n        self\n    }\n\n    pub fn build(self) -> Result<Self, io::Error> {\n        if self.host_port.is_empty() {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                \"Must provide a <host:port> to connect\".to_string(),\n            ));\n        }\n\n        Ok(Config {\n            host_port: self.host_port,\n            omit_sni: self.omit_sni,\n            connect_to: self.connect_to,\n            source_port: self.source_port,\n            verify_peer: self.verify_peer,\n            idle_timeout: self.idle_timeout,\n            max_data: self.max_data,\n            max_stream_data_bidi_local: self.max_stream_data_bidi_local,\n            max_stream_data_bidi_remote: self.max_stream_data_bidi_remote,\n            max_stream_data_uni: self.max_stream_data_uni,\n            max_streams_bidi: self.max_streams_bidi,\n            max_streams_uni: self.max_streams_uni,","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/h3i/src/config.rs#L159-L195","documentation":"h3i's Config::build validates that a host:port target was set before constructing the Config. If host_port is empty, it refuses to build and returns InvalidInput, because h3i cannot know where to connect.","triggerScenarios":"Calling Config::build() on h3i::config::Config without having called with_host_port (or equivalent), leaving host_port empty.","commonSituations":"Programmatic use of the h3i crate where the CLI normally supplies --host <host:port>; forgetting the host_port argument; parsing a CLI string into an empty value.","solutions":["Call with_host_port(\"host:port\") before build()","If driving h3i from a CLI, pass the required --host argument","Validate the host:port string is non-empty before constructing Config"],"exampleFix":"// before\nlet config = Config::new().build()?; // panics-free error: empty host_port\n// after\nlet config = Config::new().with_host_port(\"quic.nginx.org:443\").build()?;","handlingStrategy":"validation","validationCode":"if host_port.is_empty() {\n    return Err(io::Error::new(io::ErrorKind::InvalidInput, \"host:port required\"));\n}\nlet config = Config::new().with_host_port(host_port).build()?;","typeGuard":"fn has_host_port(cfg: &ConfigBuilder) -> bool { !cfg.host_port().is_empty() }","tryCatchPattern":"match config.build() {\n    Err(e) if e.kind() == io::ErrorKind::InvalidInput => eprintln!(\"--host <host:port> is required\"),\n    other => other?,\n}","preventionTips":["Always call with_host_port before build()","Validate CLI args (non-empty host:port) before constructing the builder","Surface the InvalidInput error to the user as a usage message"],"tags":["cli","config","h3i"],"backgroundTag":"missing-required-config-field","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"}