mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-28 03:48:24 +01:00
Avoid crashing when global search encounters a NoClassDefFoundError
This commit is contained in:
parent
382852d0bd
commit
9c426bc216
@ -112,8 +112,15 @@ abstract class HttpSource : CatalogueSource {
|
|||||||
* @param filters the list of filters to apply.
|
* @param filters the list of filters to apply.
|
||||||
*/
|
*/
|
||||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||||
return client.newCall(searchMangaRequest(page, query, filters))
|
return Observable.defer {
|
||||||
.asObservableSuccess()
|
try {
|
||||||
|
client.newCall(searchMangaRequest(page, query, filters)).asObservableSuccess()
|
||||||
|
} catch (e: NoClassDefFoundError) {
|
||||||
|
// RxJava doesn't handle Errors, which tends to happen during global searches
|
||||||
|
// if an old extension using non-existent classes is still around
|
||||||
|
throw RuntimeException(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
.map { response ->
|
.map { response ->
|
||||||
searchMangaParse(response)
|
searchMangaParse(response)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user