-
Notifications
You must be signed in to change notification settings - Fork 254
Open
Description
Currently, the exceptions throw by the Google API DistanceProviders do not provide much information on the actual errors encountered.
For example:
When using an Google API key with invalid referer permissions, the API response is the following JSON
{
"error_message" : "API keys with referer restrictions cannot be used with this API.",
"results" : [],
"status" : "REQUEST_DENIED"
}
Where as the exception only states "Unable to geocode address" without providing any reference to the upstream error_message.
Lines 101 to 103 in 783e5d4
if ($res['status'] !== 'OK') { | |
throw new LocalizedException(__('Unable to geocode address %1', $this->addressToString->execute($address))); | |
} |
Either logging the response error_message and status independently or adjusting the exceptions to provide more context would simplify debugging connection issues.
This likely also affects other classes that also fetch data from the Google API.
Metadata
Metadata
Assignees
Labels
No labels