fix: network safety
This commit is contained in:
parent
f03af6856a
commit
e32bfa0cfa
7 changed files with 47 additions and 28 deletions
|
@ -40,7 +40,12 @@ class MangaUpdates {
|
|||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
val res = client.post(apiUrl, json = query).parsed<MangaUpdatesResponse>()
|
||||
val res = try {
|
||||
client.post(apiUrl, json = query).parsed<MangaUpdatesResponse>()
|
||||
} catch (e: Exception) {
|
||||
Logger.log(e.toString())
|
||||
return@tryWithSuspend null
|
||||
}
|
||||
coroutineScope {
|
||||
res.results?.map {
|
||||
async(Dispatchers.IO) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue