Commit 2b4d045f authored by Max Lv's avatar Max Lv

Remove the unnecessary try-catch

parent 07bddef2
...@@ -105,18 +105,9 @@ class VpnService : BaseVpnService(), BaseService.Interface { ...@@ -105,18 +105,9 @@ class VpnService : BaseVpnService(), BaseService.Interface {
is IOException -> Crashlytics.log(Log.WARN, name, e.message) is IOException -> Crashlytics.log(Log.WARN, name, e.message)
else -> printLog(e) else -> printLog(e)
} }
try {
LocalDnsServer.prepareDnsResponse(Message(query)).apply { LocalDnsServer.prepareDnsResponse(Message(query)).apply {
header.rcode = Rcode.SERVFAIL header.rcode = Rcode.SERVFAIL
}.toWire() }.toWire()
} catch (e: Exception) {
when (e) {
is CancellationException -> { } // ignore
is IOException -> Crashlytics.log(Log.WARN, name, e.message)
else -> printLog(e)
}
null
}
}?.let { response -> }?.let { response ->
val output = DataOutputStream(socket.outputStream) val output = DataOutputStream(socket.outputStream)
output.writeShort(response.size) output.writeShort(response.size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment