{"record":{"id":"9a1743d5d2a32db6","repo":"a-b-street/abstreet","slug":"can-t-end-walking-at","errorCode":null,"errorMessage":"can't end walking at {}","messagePattern":"can't end walking at (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"sim/src/make/spawner.rs","lineNumber":308,"sourceCode":"            }\n        })\n    }\n}\n\nfn start_sidewalk_spot(endpt: TripEndpoint, map: &Map) -> Result<SidewalkSpot> {\n    match endpt {\n        TripEndpoint::Building(b) => Ok(SidewalkSpot::building(b, map)),\n        TripEndpoint::Border(i) => SidewalkSpot::start_at_border(i, map)\n            .ok_or_else(|| anyhow!(\"can't start walking from {}\", i)),\n        TripEndpoint::SuddenlyAppear(pos) => Ok(SidewalkSpot::suddenly_appear(pos, map)),\n    }\n}\n\nfn end_sidewalk_spot(endpt: TripEndpoint, map: &Map) -> Result<SidewalkSpot> {\n    match endpt {\n        TripEndpoint::Building(b) => Ok(SidewalkSpot::building(b, map)),\n        TripEndpoint::Border(i) => {\n            SidewalkSpot::end_at_border(i, map).ok_or_else(|| anyhow!(\"can't end walking at {}\", i))\n        }\n        TripEndpoint::SuddenlyAppear(_) => unreachable!(),\n    }\n}\n\nfn driving_goal(\n    endpt: TripEndpoint,\n    constraints: PathConstraints,\n    map: &Map,\n) -> Result<DrivingGoal> {\n    match endpt {\n        TripEndpoint::Building(b) => Ok(DrivingGoal::ParkNear(b)),\n        // TODO Duplicates some logic from TripEndpoint::pos\n        TripEndpoint::Border(i) => map\n            .get_i(i)\n            .some_incoming_road(map)\n            .and_then(|dr| {\n                let lanes = dr.lanes(constraints, map);","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/sim/src/make/spawner.rs#L290-L326","documentation":"This error is thrown by end_sidewalk_spot when converting a TripEndpoint::Border into a SidewalkSpot for the walking leg of a trip. SidewalkSpot::end_at_border returns None when the map cannot resolve the border intersection to a walkable sidewalk spot, so the spawner raises this anyhow error. It means trip scheduling data is inconsistent with the map's pedestrian network at that border.","triggerScenarios":"A trip is created via TripSpec::JustWalking or maybe_new with TripEndpoint::Border(i), and SidewalkSpot::end_at_border(i, map) returns None — i.e., the border intersection has no sidewalk/road mapping usable as a walking destination.","commonSituations":"Custom maps or map edits that removed or never generated sidewalks near a border; programmatically generated trips (e.g., synthetic population imports) targeting borders on a map where walking routes to that border are unavailable.","solutions":["Verify the map has sidewalk data covering the border intersection (rebuild the map from current OSM input).","Pick a different TripEndpoint (e.g., a nearby Building) when the target border cannot be resolved.","Check SidewalkSpot::end_at_border logic for the intersection and whether its roads have walking infrastructure.","Fall back to TripEndpoint::SuddenlyAppear only in synthetic/testing contexts, never production."],"exampleFix":"// before\nTripEndpoint::Border(i) => {\n    SidewalkSpot::end_at_border(i, map)\n        .ok_or_else(|| anyhow!(\"can't end walking at {}\", i))\n}\n// after (caller guards with a fallback endpoint)\nlet endpt = if SidewalkSpot::end_at_border(i, map).is_some() {\n    endpt\n} else {\n    TripEndpoint::Building(map.find_nearest_building(pt))\n};","handlingStrategy":"validation","validationCode":"// Validate the walking endpoint before scheduling\nfn walking_ok(endpt: &TripEndpoint, map: &Map) -> bool {\n    match endpt {\n        TripEndpoint::Building(_) => true,\n        TripEndpoint::Border(i) => SidewalkSpot::end_at_border(*i, map).is_some(),\n        TripEndpoint::SuddenlyAppear(_) => false,\n    }\n}","typeGuard":"fn is_walkable_border(endpt: &TripEndpoint, map: &Map) -> Option<IntersectionID> {\n    match endpt {\n        TripEndpoint::Border(i) if SidewalkSpot::end_at_border(*i, map).is_some() => Some(*i),\n        _ => None,\n    }\n}","tryCatchPattern":null,"preventionTips":["Validate border walkability before constructing TripSpec::JustWalking","Rebuild maps after OSM edits so sidewalk data stays in sync with borders","Prefer building endpoints for walking trips in synthetic data","Log the failing intersection ID to check its road/lane walking attributes"],"tags":["simulation","routing","pedestrian","map-data"],"backgroundTag":"resource-not-found","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"}