Skip to content

Commit

Permalink
IO error during flatten is expected
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Aug 19, 2019
1 parent cdefc1d commit b4f97b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
profile.method = proxy[3].trim()
}

if (route == Acl.CUSTOM_RULES) withContext(Dispatchers.IO) {
Acl.save(Acl.CUSTOM_RULES, Acl.customRules.flatten(10, service::openConnection))
if (route == Acl.CUSTOM_RULES) try {
withContext(Dispatchers.IO) {
Acl.save(Acl.CUSTOM_RULES, Acl.customRules.flatten(10, service::openConnection))
}
} catch (e: IOException) {
throw BaseService.ExpectedExceptionWrapper(e)
}

// it's hard to resolve DNS on a specific interface so we'll do it here
Expand Down

0 comments on commit b4f97b8

Please sign in to comment.