{"record":{"id":"c746b60c65b3d9b2","repo":"nikivdev/code","slug":"route-not-found","errorCode":null,"errorMessage":"Route not found: {}","messagePattern":"Route not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/domains.rs","lineNumber":210,"sourceCode":"                existing\n            );\n        }\n    }\n\n    routes.insert(host.clone(), target.clone());\n    save_routes(paths, &routes)?;\n    write_route_files(paths, &routes)?;\n    maybe_reload_running_proxy(paths, engine)?;\n    println!(\"Added route: {host} -> {target}\");\n    Ok(())\n}\n\nfn run_rm(paths: &DomainsPaths, opts: DomainsRmOpts, engine: DomainsEngine) -> Result<()> {\n    ensure_layout(paths)?;\n    let host = normalize_host(&opts.host)?;\n    let mut routes = load_routes(paths)?;\n    if routes.remove(&host).is_none() {\n        bail!(\"Route not found: {}\", host);\n    }\n    save_routes(paths, &routes)?;\n    write_route_files(paths, &routes)?;\n    maybe_reload_running_proxy(paths, engine)?;\n    println!(\"Removed route: {host}\");\n    Ok(())\n}\n\nfn run_doctor(paths: &DomainsPaths, engine: DomainsEngine) -> Result<()> {\n    if engine == DomainsEngine::Native {\n        return run_doctor_native(paths);\n    }\n    ensure_layout(paths)?;\n    let routes = load_routes(paths)?;\n\n    println!(\"Local domains doctor\");\n    println!(\"--------------------\");\n    println!(\"Config root: {}\", paths.root.display());","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/domains.rs#L192-L228","documentation":"run_rm removes a host route from the domains config. load_routes builds the map, and if routes.remove(&host) returns None the host was never registered, so the command aborts rather than writing a no-op change.","triggerScenarios":"`domains rm <host>` where the normalized host is absent from the routes file.","commonSituations":"Typos in the host name, host stored with a different subdomain than typed, removing a route that was already deleted in another terminal, or clean environments where no routes were ever added.","solutions":["List existing routes to find the exact registered host","Re-run with the exact host string stored in the routes file (e.g. linsa.localhost)","Treat the error as confirmation if the route was already removed"],"exampleFix":"// before\nf domains rm linsa.localhost  # Route not found: linsa.localhost\n// after\nf domains list  # find registered host\nf domains rm myapp.localhost","handlingStrategy":"validation","validationCode":"let routes = load_routes(&paths)?;\nlet host = normalize_host(&opts.host)?;\nif !routes.contains_key(&host) {\n    eprintln!(\"{host} is not registered; run the list command to see routes\");\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().starts_with(\"Route not found:\") => {\n        eprintln!(\"Check the exact host with the list subcommand.\");\n    }\n    other => other?,\n}","preventionTips":["Normalize hosts the same way the tool does before looking them up","List routes before removing","Make removal idempotent in scripts (ignore 'Route not found')"],"tags":["not-found","domains","lookup"],"backgroundTag":"resource-not-found","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}