fawda123 / rStrava

Functions to access data from Strava's v3 API.
154 stars 31 forks source link

Add informative error message if users have Google API disabled #69

Closed fawda123 closed 4 years ago

fawda123 commented 5 years ago

The googleway::google_elevation function is used in get_latlon and no useful error message is returned if a user does not have the API enabled.

From #66:

# Get polyline and confirm its a straightforward character string
polyline<-my_actsDF$data[[1]]$map.summary_polyline

# Use google_elevation as per rStrava’s get_latlon to unpack polyline
googleway::google_elevation(polyline = polyline, key = mykey)

$error_message
[1] "This API project is not authorized to use this API."

$results
list()

$status
[1] "REQUEST_DENIED"
fawda123 commented 4 years ago

4472d0dd16ca1352b3c3a4340228de0b7eb2f272

fawda123 commented 4 years ago

Note that this fix is generic, it will return any error message returned from the Google API