Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9a0d6dc authored by Hasib Prince's avatar Hasib Prince
Browse files

exception handling is added

parent a02e217f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -185,6 +185,10 @@ class GPlayHttpClient @Inject constructor(

            Timber.d("$TAG: Url: ${response.request.url}\nStatus: $code")

            if (code != 200) {
                throw GplayException(code, response.message)
            }

            if (code == 401) {
                MainScope().launch {
                    EventBus.invokeEvent(
@@ -203,3 +207,5 @@ class GPlayHttpClient @Inject constructor(
        }
    }
}

class GplayException (val errorCode: Int, message: String) : Exception(message)