graphhopper / map-matching

The map matching functionality is now located in the main repository https://github.com/graphhopper/graphhopper#map-matching
https://www.graphhopper.com/open-source/
Apache License 2.0
785 stars 273 forks source link

SAXParseException should be handled as bad request #123

Closed karussell closed 6 years ago

karussell commented 6 years ago

A parse exception of the GPX file should be handled as 'Bad Request'. Currently it is some 50x:

java.lang.RuntimeException: org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 15; The element type "gpx" must be terminated by the matching end-tag "</gpx>".
        at com.graphhopper.matching.GPXFile.doImport(GPXFile.java:160)

Same for ParseException:

java.lang.RuntimeException: java.text.ParseException: Unparseable date: "2018-07-18T09:1245"
        at com.graphhopper.matching.GPXFile.doImport(GPXFile.java:157)
        at com.graphhopper.matching.http.MapMatchingResource.doGet(MapMatchingResource.java:95)
michaz commented 6 years ago

Solved by deserializing through Dropwizard/Jersey/Jackson.