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

Commit 5c50f367 authored by cketti's avatar cketti
Browse files

Change AuthenticationFailedException to expose alert text from server

parent 262e0840
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line

package com.fsck.k9.mail;

public class AuthenticationFailedException extends MessagingException {
    public static final long serialVersionUID = -1;

    public AuthenticationFailedException(String message) {
        super(message);
    }

    public AuthenticationFailedException(String message, Throwable throwable) {
        super(message, throwable);
    }
}
+9 −0
Original line number Diff line number Diff line
package com.fsck.k9.mail

class AuthenticationFailedException @JvmOverloads constructor(
        message: String,
        throwable: Throwable? = null,
        val messageFromServer: String? = null
) : MessagingException(message, throwable) {
    val isMessageFromServerAvailable = messageFromServer != null
}
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ class ImapConnection {

    private AuthenticationFailedException handlePermanentXoauth2Failure(NegativeImapResponseException e) {
        Timber.v(e, "Permanent failure during XOAUTH2");
        return new AuthenticationFailedException(e.getMessage(), e);
        return new AuthenticationFailedException(e.getMessage(), e, e.getAlertText());
    }

    private List<ImapResponse> handleTemporaryXoauth2Failure(NegativeImapResponseException e) throws IOException, MessagingException {