Avoid crashing when global search encounters a NoClassDefFoundError
(cherry picked from commit 9c426bc216d2ca61dd1168f119b4ddc99e770e47)
This commit is contained in:
parent
ddf9a81335
commit
8a32db268e
@ -143,8 +143,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…
x
Reference in New Issue
Block a user