{"record":{"id":"db453acc2c12bdb8","repo":"Hmbown/CodeWhale","slug":"base-url-cannot-be-empty","errorCode":null,"errorMessage":"base URL cannot be empty","messagePattern":"base URL cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":11226,"sourceCode":"        )\n    })\n    .with_context(|| format!(\"Failed to write config to {}\", config_path.display()))?;\n    Ok(config_path)\n}\n\n/// Persist a guided-setup endpoint choice into the provider's own\n/// `[providers.<name>] base_url` (#4526).\n///\n/// Deliberately narrow: it never touches the root `base_url`, another\n/// provider's table, or any other key, so a billing-route choice cannot\n/// repoint an unrelated route.\npub(crate) fn save_provider_base_url_for_identity(\n    identity: &ProviderIdentity,\n    _route_config: &Config,\n    base_url: &str,\n) -> Result<PathBuf> {\n    let base_url = base_url.trim();\n    anyhow::ensure!(!base_url.is_empty(), \"base URL cannot be empty\");\n    let config_path = try_default_config_path()\n        .context(\"Failed to resolve config path for provider base URL.\")?;\n    ensure_parent_dir(&config_path)?;\n    let key_inside = if identity.provider == ApiProvider::Custom {\n        let key = identity.key.trim();\n        anyhow::ensure!(!key.is_empty(), \"custom provider id cannot be empty\");\n        key\n    } else {\n        provider_config_key(identity.provider).context(\"provider base URL table\")?\n    };\n    crate::config_persistence::mutate_config_document(&config_path, |doc| {\n        crate::config_persistence::set_document_value(\n            doc,\n            &[\"providers\", key_inside, \"base_url\"],\n            base_url,\n        )\n    })\n    .with_context(|| format!(\"Failed to write config to {}\", config_path.display()))?;","sourceCodeStart":11208,"sourceCodeEnd":11244,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/config.rs#L11208-L11244","documentation":"Error \"base URL cannot be empty\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/config.rs:11226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}