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

Commit 3e0f4ec3 authored by David Luhmer's avatar David Luhmer
Browse files

better error handling

parent 8094fc9f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountPermissionNo
import com.nextcloud.android.sso.exceptions.NextcloudFilesAppNotInstalledException;
import com.nextcloud.android.sso.exceptions.NextcloudFilesAppNotSupportedException;
import com.nextcloud.android.sso.exceptions.SSOException;
import com.nextcloud.android.sso.exceptions.UnknownErrorException;
import com.nextcloud.android.sso.model.FilesAppType;
import com.nextcloud.android.sso.model.SingleSignOnAccount;
import com.nextcloud.android.sso.ui.UiExceptionManager;
@@ -329,8 +330,13 @@ public class AccountImporter {
    }

    public static void handleFailedAuthRequest(Intent data) throws SSOException {
        if(data != null) {
            String exception = data.getStringExtra(NEXTCLOUD_SSO_EXCEPTION);
            throw SSOException.parseNextcloudCustomException(new Exception(exception));
        } else {
            Log.e(TAG, "handleFailedAuthRequest failed - data is null");
            throw new UnknownErrorException("Authentication request failed - no details available");
        }
    }

    public static void authenticateSingleSignAccount(Fragment fragment, SingleSignOnAccount account) throws NextcloudFilesAppNotSupportedException, NextcloudFilesAppAccountPermissionNotGrantedException {