WorldBank-Transport / DRIVER

DRIVER - Data for Road Incident Visualization, Evaluation, and Reporting
GNU General Public License v3.0
37 stars 34 forks source link

Improve error message for uploading boundaries #796

Open tgilcrest opened 5 years ago

tgilcrest commented 5 years ago

Related to the discussion in #790, we should improve the error message on the shapefile upload for boundaries. When an error is encountered, the error message returned is simply: Error - check that your upload is a valid shapefile.

image

However, in the dev console, we see that a more specific error is returned:

"errors":{"message":"Shapefile must include a .prj file"}

or

"errors":{"message":"Feature is not a MultiPolygon or Polygon"}

The UI should return the more specific error message so the user knows what is wrong with the upload without having to dig into the dev console.

In addition, the response returns a 201 Created, which seems incorrect, and should probably be some 400-level response.