From 986d12b2c8624d0eff406efbbc6316f181f75228 Mon Sep 17 00:00:00 2001 From: abdul4samad Date: Tue, 5 Jan 2021 17:49:01 +0530 Subject: [PATCH 1/3] fix: googlemaps#697 Changed expected error message in to ApiException --- src/main/java/com/google/maps/errors/ApiException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/google/maps/errors/ApiException.java b/src/main/java/com/google/maps/errors/ApiException.java index a9ce3be3a..b262456f4 100644 --- a/src/main/java/com/google/maps/errors/ApiException.java +++ b/src/main/java/com/google/maps/errors/ApiException.java @@ -49,7 +49,7 @@ public static ApiException from(String status, String errorMessage) { } else if ("NOT_FOUND".equals(status)) { return new NotFoundException(errorMessage); } else if ("OVER_QUERY_LIMIT".equals(status)) { - if ("You have exceeded your daily request quota for this API." + if ("You have exceeded your daily request quota for this API. If you did not set a custom daily request quota, verify your project has an active billing account: http://g.co/dev/maps-no-account" .equalsIgnoreCase(errorMessage)) { return new OverDailyLimitException(errorMessage); } From 8d084a8d201ad6a9911a11a536c3856eda3f8b28 Mon Sep 17 00:00:00 2001 From: Abdul Samad Date: Tue, 5 Jan 2021 21:52:40 +0530 Subject: [PATCH 2/3] Update src/main/java/com/google/maps/errors/ApiException.java Co-authored-by: Justin Poehnelt --- src/main/java/com/google/maps/errors/ApiException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/google/maps/errors/ApiException.java b/src/main/java/com/google/maps/errors/ApiException.java index b262456f4..493fbf361 100644 --- a/src/main/java/com/google/maps/errors/ApiException.java +++ b/src/main/java/com/google/maps/errors/ApiException.java @@ -49,7 +49,7 @@ public static ApiException from(String status, String errorMessage) { } else if ("NOT_FOUND".equals(status)) { return new NotFoundException(errorMessage); } else if ("OVER_QUERY_LIMIT".equals(status)) { - if ("You have exceeded your daily request quota for this API. If you did not set a custom daily request quota, verify your project has an active billing account: http://g.co/dev/maps-no-account" + if ("You have exceeded your daily request quota for this API. If you did not set a custom daily request quota, verify your project has an active billing account." .equalsIgnoreCase(errorMessage)) { return new OverDailyLimitException(errorMessage); } From a19a090a0c7e36f6edbe3c1fabaf77bebd687d25 Mon Sep 17 00:00:00 2001 From: abdul4samad Date: Wed, 6 Jan 2021 23:10:42 +0530 Subject: [PATCH 3/3] fix: googlemaps#675 Changed return logic of DirectionsApi --- src/main/java/com/google/maps/DirectionsApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/google/maps/DirectionsApi.java b/src/main/java/com/google/maps/DirectionsApi.java index 212e212b6..415ece739 100644 --- a/src/main/java/com/google/maps/DirectionsApi.java +++ b/src/main/java/com/google/maps/DirectionsApi.java @@ -71,7 +71,7 @@ public static class Response implements ApiResponse { @Override public boolean successful() { - return "OK".equals(status) || "ZERO_RESULTS".equals(status); + return "OK".equals(status); } @Override