Skip to content

Commit 81f9fa9

Browse files
authored
Merge pull request #219 from Iterable/bugfix/MOB-1363-catch-okhttp-error
[MOB-1363] Catch all exceptions in IterableRequest
2 parents 2129624 + d16642a commit 81f9fa9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableRequest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ protected String doInBackground(IterableApiRequest... params) {
189189
} catch (IOException e) {
190190
logError(baseUrl, e);
191191
handleFailure(e.getMessage(), null);
192+
} catch (ArrayIndexOutOfBoundsException e) {
193+
// This exception is sometimes thrown from the inside of HttpUrlConnection/OkHttp
194+
logError(baseUrl, e);
195+
handleFailure(e.getMessage(), null);
196+
} catch (Exception e) {
197+
logError(baseUrl, e);
198+
handleFailure(e.getMessage(), null);
192199
} finally {
193200
if (urlConnection != null) {
194201
urlConnection.disconnect();

0 commit comments

Comments
 (0)