exception test 2

This commit is contained in:
X1nto 2020-07-01 16:24:20 +04:00
parent 55bd10d6f5
commit 2f191bbb7e
3 changed files with 3 additions and 14 deletions

View File

@ -28,10 +28,7 @@ class MicrogDownloadService: Service() {
try {
downloadMicrog()
} catch (e: Exception) {
when (e) {
is ExecutionException, is InterruptedException, is IllegalStateException -> Toast.makeText(this, "Unable to download MicroG", Toast.LENGTH_SHORT).show()
else -> throw e
}
Toast.makeText(this, "Unable to download MicroG", Toast.LENGTH_SHORT).show()
}
stopSelf()
return START_NOT_STICKY

View File

@ -31,11 +31,7 @@ class VancedDownloadService: Service() {
try {
downloadSplits()
} catch (e: Exception) {
when (e) {
is ExecutionException, is InterruptedException, is IllegalStateException -> Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
else -> throw e
}
Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
}
stopSelf()
return START_NOT_STICKY

View File

@ -46,11 +46,7 @@ object InternetTools {
try {
GetJson().AsJSONObject("$installUrl/$json").get(obj).asInt
} catch (e: Exception) {
when (e) {
is InterruptedException, is ExecutionException -> GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/$json").get(obj).asInt
else -> throw e
}
GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/$json").get(obj).asInt
}
} else 0
}