forked from github/wulkanowy-mirror
Add Vulcan and Scrapper Exceptions to known exceptions (#994)
This commit is contained in:
parent
db9c2640c7
commit
e7221e6a32
@ -128,7 +128,7 @@ configurations.all {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "io.github.wulkanowy:sdk:4d7e031"
|
||||
implementation "io.github.wulkanowy:sdk:e769c83"
|
||||
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
|
||||
|
||||
|
@ -4,7 +4,9 @@ import android.content.res.Resources
|
||||
import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.sdk.exception.FeatureNotAvailableException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.FeatureDisabledException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.ScrapperException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.ServiceUnavailableException
|
||||
import io.github.wulkanowy.sdk.scrapper.exception.VulcanException
|
||||
import io.github.wulkanowy.sdk.scrapper.login.NotLoggedInException
|
||||
import io.github.wulkanowy.sdk.scrapper.login.PasswordChangeRequiredException
|
||||
import okhttp3.internal.http2.StreamResetException
|
||||
@ -21,5 +23,7 @@ fun Resources.getString(error: Throwable) = when (error) {
|
||||
is ServiceUnavailableException -> getString(R.string.error_service_unavailable)
|
||||
is FeatureDisabledException -> getString(R.string.error_feature_disabled)
|
||||
is FeatureNotAvailableException -> getString(R.string.error_feature_not_available)
|
||||
is VulcanException -> getString(R.string.error_unknown_uonet)
|
||||
is ScrapperException -> getString(R.string.error_unknown_app)
|
||||
else -> getString(R.string.error_unknown)
|
||||
}
|
||||
|
@ -448,9 +448,11 @@
|
||||
<!--Errors-->
|
||||
<string name="error_no_internet">Brak połączenia z internetem</string>
|
||||
<string name="error_timeout">Upłynął limit czasu na połączenie z dziennikiem</string>
|
||||
<string name="error_login_failed">Logowanie nie powiodło się. Spróbuj ponownie lub zrestartuj aplikację</string>
|
||||
<string name="error_login_failed">Logowanie nie powiodło się. Spróbuj ponownie</string>
|
||||
<string name="error_password_change_required">Wymagana zmiana hasła</string>
|
||||
<string name="error_service_unavailable">Trwa przerwa techniczna dziennika UONET+. Spróbuj ponownie później</string>
|
||||
<string name="error_unknown_uonet">Wystąpił nieznany błąd dziennika UONET+. Spróbuj ponownie później</string>
|
||||
<string name="error_unknown_app">Wystąpił nieznany błąd aplikacji</string>
|
||||
<string name="error_unknown">Wystąpił nieoczekiwany błąd</string>
|
||||
<string name="error_feature_disabled">Funkcja wyłączona przez szkołę</string>
|
||||
<string name="error_feature_not_available">Funkcja niedostępna. Zaloguj się w trybie innym niż Mobilne API</string>
|
||||
|
@ -482,9 +482,11 @@
|
||||
<!--Errors-->
|
||||
<string name="error_no_internet">No internet connection</string>
|
||||
<string name="error_timeout">Connection to the register timed out</string>
|
||||
<string name="error_login_failed">Login failed. Try again or restart the app</string>
|
||||
<string name="error_login_failed">Login failed. Try again</string>
|
||||
<string name="error_password_change_required">Password change required</string>
|
||||
<string name="error_service_unavailable">Maintenance underway UONET + register. Try again later</string>
|
||||
<string name="error_unknown_uonet">Unknown UONET + register error. Try again later</string>
|
||||
<string name="error_unknown_app">Unknown application error</string>
|
||||
<string name="error_unknown">An unexpected error occurred</string>
|
||||
<string name="error_feature_disabled">Feature disabled by your school</string>
|
||||
<string name="error_feature_not_available">Feature not available. Login in a mode other than Mobile API</string>
|
||||
|
@ -17,13 +17,14 @@ import com.google.android.play.core.install.model.UpdateAvailability.DEVELOPER_T
|
||||
import com.google.android.play.core.install.model.UpdateAvailability.UPDATE_AVAILABLE
|
||||
import com.google.android.play.core.ktx.isFlexibleUpdateAllowed
|
||||
import com.google.android.play.core.ktx.isImmediateUpdateAllowed
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import io.github.wulkanowy.R
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class UpdateHelper @Inject constructor(private val context: Context) {
|
||||
class UpdateHelper @Inject constructor(@ApplicationContext private val context: Context) {
|
||||
|
||||
lateinit var messageContainer: View
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user