codeforhuntsville / Frontier

A civic app for finding whats near me
http://codeforhuntsville.com/
MIT License
9 stars 7 forks source link

Error when Google Places does not return results #18

Closed chadxz closed 9 years ago

chadxz commented 9 years ago

Reported in #17 but creating a new issue here as that one has a different primary theme.

The bug was this:

Error retrieving restaurants
TypeError: restaurants.map is not a function

Being reported on the client side. We can put in two fixes for this, one on the server and one on the client to be extra safe. The one on the server will need to watch for an empty results list, and the one on the client will need to make sure the restaurants are an array prior to trying to call map on it.

dannagle commented 9 years ago

Error I now get is:

Error retrieving restaurants
Error: server not configured for restaurant lookup

You can look at my dev environment tomorrow.

dannagle commented 9 years ago

Maybe I missed a configuration:

:8080/restaurants?latitude=34.8114868&longitude=-86.76075589999999

Response:

{"error":"internal server error","statusCode":500,"description":"server not configured for restaurant lookup"}
dustywusty commented 9 years ago

@chadxz we might consider having the server bail if the google places api key is not set

chadxz commented 9 years ago

@clarkda yeah, that would probably be better. We can make it print a clear error message with steps to remediate.

@dannagle, the problem is that we haven't properly documented a requirement of the app. See https://github.com/codeforhuntsville/Frontier/issues/9#issuecomment-101507165