Skip to content

fix: Better error handling in shapes_from_kml - #1414

Open
zyxw59 wants to merge 2 commits into
masterfrom
emily-shapes-from-kml-error
Open

fix: Better error handling in shapes_from_kml#1414
zyxw59 wants to merge 2 commits into
masterfrom
emily-shapes-from-kml-error

Conversation

@zyxw59

@zyxw59 zyxw59 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Asana Ticket: extra

Adds additional validation/handling in shapes_from_kml that will return an error on a malformed file rather than crashing.

Sentry link: https://mbtace.sentry.io/issues/7636773354/?referrer=slack&notification_uuid=3a35208d-6121-48d9-b978-142cd216356e&environment=prod&alert_rule_id=13911605&alert_type=issue

Reviewer Checklist

  • Meets ticket's acceptance criteria
  • Any new or changed functions have typespecs
  • Tests were added for any new functionality (don't just rely on Codecov)
  • This branch was deployed to the staging environment and is currently running with no unexpected increase in warnings, and no errors or crashes.

@zyxw59
zyxw59 requested a review from a team as a code owner July 28, 2026 15:12
@zyxw59
zyxw59 requested review from lemald and removed request for a team July 28, 2026 15:12
@zyxw59

zyxw59 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Was it @dks-mbta who had the bad shapefile that triggered this?

Comment on lines +89 to +92
_ ->
{:error,
{"Failed to parse shape from kml, placemarks are of unexpected type.",
[inspect(placemarks)]}}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: we should probably add a unit test for this (or is that what you're asking for the example malformed KML for?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants