hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

Error messages into error-callback #79

Closed m1ga closed 7 years ago

m1ga commented 7 years ago

Messages like:

{ error_message: 'Browser API keys cannot have referer restrictions when used with this API.', status: 'REQUEST_DENIED', routes: [] }

{ error_message: 'The provided API key is expired.', status: 'REQUEST_DENIED', routes: [] }

{ error_message: 'This API project is not authorized to use this API. Please ensure this API is activated in the Google Developers Console: https://console.developers.google.com/apis/api/directions_backend?project=_', status: 'REQUEST_DENIED', routes: [] }

appear in the success callback. Should be in the error callback (in my case it was the getDirections() example/method)

hansemannn commented 7 years ago

Yeah, the Google API doesn't use proper HTTP status codes. I'll add a manual error handling and file a ticket at Google's radar.