{"record":{"id":"fffa17ca4b33a477","repo":"a-b-street/abstreet","slug":"don-t-know-how-to-load","errorCode":null,"errorMessage":"Don't know how to load {}","messagePattern":"Don't know how to load (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sim/src/make/load.rs","lineNumber":132,"sourceCode":"            if opts.run_name == \"unnamed\" {\n                opts.run_name = scenario.scenario_name.clone();\n            }\n            let mut sim = Sim::new(&map, opts);\n            sim.instantiate(&scenario, &map, &mut rng, timer);\n\n            (map, sim, rng)\n        } else if self.load.contains(\"/raw_maps/\") || self.load.contains(\"/maps/\") {\n            info!(\"Loading map {}\", self.load);\n\n            let map = Map::load_synchronously(self.load.clone(), timer);\n\n            timer.start(\"create sim\");\n            let sim = Sim::new(&map, opts);\n            timer.stop(\"create sim\");\n\n            (map, sim, rng)\n        } else {\n            panic!(\"Don't know how to load {}\", self.load);\n        }\n    }\n}\n","sourceCodeStart":114,"sourceCodeEnd":136,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/sim/src/make/load.rs#L114-L136","documentation":"load_synchronously dispatches on the `load` string: empty, a path containing /scenarios/, a scenario json, a save, etc. If none of the known patterns match, the loader has no strategy for the value and panics rather than guessing.","triggerScenarios":"Setting SimFlags.load to an unrecognized string (or a path matching none of the expected suffixes like /scenarios/ or .json scenario/save conventions) and calling load_synchronously.","commonSituations":"Passing a raw map name where a full path is expected; typos in the load path; loading a custom file type the headless loader was never taught to handle.","solutions":["Check SimFlags::initialize / the load dispatch code for the accepted formats and use one","Pass a full, correctly-suffixed path produced by the library's own path helpers (abstutil)","Log the exact `load` value and compare against branches in load_synchronously"],"exampleFix":"// before\nflags.load = \"some_mystery_file\".to_string();\n// after\nflags.initialize(map_name); // let the library compute a valid load path","handlingStrategy":"validation","validationCode":"let load = &flags.load;\nlet recognized = load.is_empty()\n    || load.contains(\"/scenarios/\")\n    || load.ends_with(\".json\");\nif !recognized { eprintln!(\"unsupported load value: {}\", load); }","typeGuard":null,"tryCatchPattern":"let result = std::panic::catch_unwind(|| flags.load_synchronously(&mut timer));","preventionTips":["Build load paths with the library's own helpers (abstutil), not string concatenation","Match the accepted patterns in load_synchronously before assigning flags.load"],"tags":["rust","panic","unsupported-operation","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}