mirror of
https://github.com/tachiyomiorg/extensions-lib.git
synced 2024-11-25 20:56:55 +01:00
Share HttpException from the app with the extensions-lib. (#12)
This commit is contained in:
parent
542ff26701
commit
b107ef035e
@ -9,3 +9,12 @@ fun Call.asObservable(): Observable<Response> = throw Exception("Stub!")
|
||||
fun Call.asObservableSuccess(): Observable<Response> = throw Exception("Stub!")
|
||||
|
||||
suspend fun Call.await(): Response = throw Exception("Stub!")
|
||||
|
||||
/**
|
||||
* Exception that handles HTTP codes considered not successful by OkHttp.
|
||||
* Use it to have a standardized error message in the app across the extensions.
|
||||
*
|
||||
* @since extensions-lib 1.5
|
||||
* @param code [Int] the HTTP status code
|
||||
*/
|
||||
class HttpException(val code: Int) : IllegalStateException("HTTP error $code")
|
||||
|
Loading…
Reference in New Issue
Block a user