Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This fixes square#3438
  • Loading branch information
datayja committed Sep 23, 2017
1 parent 525db98 commit a292f78
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package okhttp3.internal.platform;

import android.os.Build;
import android.util.Log;
import java.io.IOException;
import java.lang.reflect.Constructor;
Expand Down Expand Up @@ -76,6 +77,13 @@ class AndroidPlatform extends Platform {
IOException ioException = new IOException("Exception in connect");
ioException.initCause(e);
throw ioException;
} catch (ClassCastException e) {
// On android 8.0, socket.connect throws a ClassCastException due to a bug
if (Build.VERSION.SDK_INT == 26) {
log(WARN, "Swallowed ClassCastException, see https://issuetracker.google.com/issues/63649622", e);
} else {
throw e;
}
}
}

Expand Down

0 comments on commit a292f78

Please sign in to comment.