Skip to content

Commit 6919196

Browse files
committed
Improve error-ignoring within the VPN
Turns out some devices/OSs/something format these errors slightly differently, and we weren't catching those. Widen the net.
1 parent b05b980 commit 6919196

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/tech/httptoolkit/android/ProxyVpnRunnable.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ class ProxyVpnRunnable(
8585

8686
val isIgnorable =
8787
(e is ConnectException && errorMessage == "Permission denied") ||
88+
// Nothing we can do if the internet goes down:
8889
(e is ConnectException && errorMessage == "Network is unreachable") ||
90+
(e is ConnectException && errorMessage.contains("ENETUNREACH")) ||
91+
// Too many open files - can't make more sockets, not much we can do:
92+
(e is ConnectException && errorMessage == "Too many open files") ||
93+
(e is ConnectException && errorMessage.contains("EMFILE")) ||
94+
// IPv6 is not supported here yet:
8995
(e is PacketHeaderException && errorMessage.contains("IP version should be 4 but was 6"))
9096

9197
if (!isIgnorable) {

0 commit comments

Comments
 (0)