0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-02 01:02:39 +00:00

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
}