Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error handling when adding malformed GeoJSON #16611

Closed
noahmoss opened this issue Jun 16, 2021 · 2 comments · Fixed by #16688
Closed

Better error handling when adding malformed GeoJSON #16611

noahmoss opened this issue Jun 16, 2021 · 2 comments · Fixed by #16688

Comments

@noahmoss
Copy link
Member

Describe the bug
When adding GeoJSON for a custom map that is malformed JSON or GeoJSON (to populate the identifier/display name dropdowns), the modal is closed and a stack trace is displayed in the bottom right of the screen. This is similar to #14635 but is a different underlying problem, and won't be resolved by my fix to that issue.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Admin -> Settings -> Maps
  2. Click on 'Add a map'
  3. Type in an arbitrary name
  4. Add a URL pointing to malformed GeoJSON. The test file we're currently using for our backend tests actually triggers this, since it's missing a top-level features field: https://raw.githubusercontent.com/metabase/metabase/master/test_resources/test.geojson

Expected behavior
An sane error message should be shown instead of the stack trace

Screenshots

geojson-error.mov

Information about your Metabase Installation:

Current master branch on Firefox and MacOS

@flamber
Copy link
Contributor

flamber commented Jun 16, 2021

On pre-39 it would just create an unhelpful error, which is closer to a P3, but the "Something went wrong" makes it a P2
image

@noahmoss
Copy link
Member Author

This also happens if you put in a URL like https://metabase.com which passes backend validation but isn't JSON.

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

Successfully merging a pull request may close this issue.

2 participants