Skip to content

Commit 6dc8dce

Browse files
committed
bug fixes
1 parent 465c4a1 commit 6dc8dce

4 files changed

Lines changed: 6 additions & 1 deletion

File tree

baatolibrary/src/main/java/com/baato/baatolibrary/services/BaatoPlace.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.baato.baatolibrary.services;
22

33
import android.content.Context;
4+
import android.util.Log;
5+
import android.widget.Toast;
46

57
import androidx.annotation.NonNull;
68

@@ -93,6 +95,7 @@ public void onResponse(Call<PlaceAPIResponse> call, Response<PlaceAPIResponse> r
9395
else {
9496
try {
9597
baatoPlaceListener.onFailed(new Throwable(response.errorBody().string()));
98+
cancelRequest();
9699
} catch (IOException e) {
97100
e.printStackTrace();
98101
}

baatolibrary/src/main/java/com/baato/baatolibrary/services/BaatoReverse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void onResponse(Call<PlaceAPIResponse> call, Response<PlaceAPIResponse> r
107107
else {
108108
try {
109109
baatoReverseRequestListener.onFailed(new Throwable(response.errorBody().string()));
110-
Log.d(TAG, "onResponse: ");
110+
cancelRequest();
111111
} catch (Exception e) {
112112
e.printStackTrace();
113113
}

baatolibrary/src/main/java/com/baato/baatolibrary/services/BaatoRouting.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public void onResponse(Call<DirectionsAPIResponse> call, Response<DirectionsAPIR
135135
} else {
136136
try {
137137
baatoRoutingRequestListener.onFailed(new Throwable(response.errorBody().string()));
138+
cancelRequest();
138139
} catch (IOException e) {
139140
e.printStackTrace();
140141
}

baatolibrary/src/main/java/com/baato/baatolibrary/services/BaatoSearch.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public void onResponse(Call<SearchAPIResponse> call, Response<SearchAPIResponse>
130130
else {
131131
try {
132132
baatoSearchRequestListener.onFailed(new Throwable(response.errorBody().string()));
133+
cancelRequest();
133134
} catch (IOException e) {
134135
e.printStackTrace();
135136
}

0 commit comments

Comments
 (0)