Skip to content

Commit

Permalink
Merge pull request #55 from square/master
Browse files Browse the repository at this point in the history
  • Loading branch information
GulajavaMinistudio authored Sep 26, 2017
2 parents 81224b0 + aed2224 commit 0a520ea
Showing 1 changed file with 11 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,16 @@ 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
// see https://issuetracker.google.com/issues/63649622
if (Build.VERSION.SDK_INT == 26) {
IOException ioException = new IOException("Exception in connect");
ioException.initCause(e);
throw ioException;
} else {
throw e;
}
}
}

Expand Down

0 comments on commit 0a520ea

Please sign in to comment.