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

Service throws error if postcode cannot be found #40

Closed
SBRitter opened this issue Aug 3, 2016 · 1 comment · Fixed by #44
Closed

Service throws error if postcode cannot be found #40

SBRitter opened this issue Aug 3, 2016 · 1 comment · Fixed by #44
Assignees

Comments

@SBRitter
Copy link
Contributor

SBRitter commented Aug 3, 2016

An error is thrown if the postcode cannot be found in JSON coming from Nominatim.

Sample error output:

[error] play - Cannot invoke the action, eventually got an error: org.json.JSONException: JSONObject["postcode"] not found.
[error] application - 

! @711781k9f - Internal server error, for (GET) [/geodata/long/J%205/Mannheim/DE] ->

play.api.Application$$anon$1: Execution exception[[JSONException: JSONObject["postcode"] not found.]]
    at play.api.Application$class.handleError(Application.scala:296) ~[play_2.11-2.3.4.jar:2.3.4]
    at play.api.DefaultApplication.handleError(Application.scala:402) [play_2.11-2.3.4.jar:2.3.4]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.11-2.3.4.jar:2.3.4]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [play_2.11-2.3.4.jar:2.3.4]
    at scala.Option.map(Option.scala:145) [scala-library-2.11.1.jar:na]
Caused by: org.json.JSONException: JSONObject["postcode"] not found.
    at org.json.JSONObject.get(JSONObject.java:476) ~[json-20141113.jar:na]
    at controllers.geo.NominatimQuery.getPostcode(NominatimQuery.java:47) ~[classes/:na]
    at controllers.geo.NominatimQuery.createGeoNode(NominatimQuery.java:59) ~[classes/:na]
    at controllers.geo.GeoInformator.getFirstGeoNode(GeoInformator.java:95) ~[classes/:na]
    at controllers.geo.GeoInformator.getLatLong(GeoInformator.java:82) ~[classes/:na]

@SBRitter SBRitter added the bug label Aug 3, 2016
@SBRitter SBRitter self-assigned this Aug 3, 2016
@fsteeg fsteeg added the ready label Aug 25, 2016
@fsteeg fsteeg self-assigned this Aug 25, 2016
@fsteeg fsteeg added working and removed ready labels Aug 25, 2016
@fsteeg
Copy link
Member

fsteeg commented Aug 26, 2016

@fsteeg fsteeg added review and removed working labels Aug 26, 2016
@fsteeg fsteeg assigned SBRitter and unassigned fsteeg Aug 26, 2016
fsteeg added a commit that referenced this issue Aug 29, 2016
To distinguish processing errors from actual `not found` errors
due to wrong paths when calling from a client.

See also hbz/lobid-organisations#77
@SBRitter SBRitter removed the review label Sep 8, 2016
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