Currently the Client->getDirections() method will return the route object if a request fails in some way or other (e.g. HTTP status not 200 or JSON object status property not "ok"). The remaining coordinates of the route object will however no longer contain the coordinates for which the request fails. This behavior is still wanted for this method, as it allows for a comparatively simple implementation of calling code using the client and not handling such incidents as errors.
To allow for implementations where the calling code can easily handle such responses and for example attempt another request only passing a portion of waypoints a new method should be introduced that throws exceptions in such cases. The new method shall also allow passing an optional parameter to specify a number of waypoints lesser than the limit Google allows and greater or equal than zero. The proposed signature would be:
Client->getDirectionsFailsOnIrregularity($maxWayPoints = Client::MAX_WAYPOINTS_LIMIT)
Currently the Client->getDirections() method will return the route object if a request fails in some way or other (e.g. HTTP status not 200 or JSON object status property not "ok"). The remaining coordinates of the route object will however no longer contain the coordinates for which the request fails. This behavior is still wanted for this method, as it allows for a comparatively simple implementation of calling code using the client and not handling such incidents as errors.
To allow for implementations where the calling code can easily handle such responses and for example attempt another request only passing a portion of waypoints a new method should be introduced that throws exceptions in such cases. The new method shall also allow passing an optional parameter to specify a number of waypoints lesser than the limit Google allows and greater or equal than zero. The proposed signature would be:
Client->getDirectionsFailsOnIrregularity($maxWayPoints = Client::MAX_WAYPOINTS_LIMIT)