-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle lock-out for Google Drive and show a user readable error
- Loading branch information
Showing
5 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
syncs-gdrive/src/main/java/eu/darken/octi/syncs/gdrive/core/UserLockedOutException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package eu.darken.octi.syncs.gdrive.core | ||
|
||
import android.content.Context | ||
import eu.darken.octi.common.error.HasLocalizedError | ||
import eu.darken.octi.common.error.LocalizedError | ||
import eu.darken.octi.syncs.gdrive.R | ||
|
||
class UserLockedOutException( | ||
cause: Exception, | ||
) : IllegalStateException(cause), HasLocalizedError { | ||
override fun getLocalizedError(context: Context): LocalizedError = LocalizedError( | ||
throwable = this, | ||
label = context.getString(R.string.gdrive_account_lockout_error_label), | ||
description = context.getString(R.string.gdrive_account_lockout_error_description) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<resources> | ||
<string name="gdrive_account_scope_error_label">Permission error</string> | ||
<string name="gdrive_account_scope_error_description">Octi has not been granted the required access scope. Try again and check that permissions are being granted.</string> | ||
<string name="gdrive_account_lockout_error_label">Lock out error</string> | ||
<string name="gdrive_account_lockout_error_description">This device is locked out and can\'t access Google Drive anymore. It\'s access to your Google account has been revoked. Re-grant access and try again.</string> | ||
</resources> |