a-b-street/abstreet · error

invalid

Error message

{} invalid: {}

What it means

Position::pt looks up the point at dist_along along the lane's center polyline. This fires when the stored dist_along is out of bounds for the lane — the Position is stale or was constructed against a different map where the lane was longer. It is a validity guard: the {} in the message is the Position itself and {} is the underlying DistAlongPolyline error.

Solutions

  1. Recreate the Position against the current map so dist_along fits the lane length
  2. Clamp or re-derive dist_along before calling pt, or use a fallible lookup instead
  3. Trace where the stale Position came from (likely a deserialized path or a map that shrank the lane)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at map_model/src/traversable.rs:57 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13). Data as JSON: /api/errors/c721b247aeb6509d. Report an issue: GitHub.

Appendix: source

Thrown at map_model/src/traversable.rs:57

pub fn pt(&self, map: &Map) -> Pt2D {
    match map
        .get_l(self.lane)
        .lane_center_pts
        .dist_along(self.dist_along)
    {
        Ok((pt, _)) => pt,
        Err(err) => panic!("{} invalid: {}", self, err),
    }
}

View on GitHub (pinned to 0964f29315)