mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 14:41:08 +00:00
Propagate POP3 I/O errors
This commit is contained in:
parent
8a55f196fe
commit
1544b41f45
2 changed files with 14 additions and 7 deletions
|
@ -288,7 +288,10 @@ public class POP3Store extends Store {
|
|||
} catch (EOFException ex) {
|
||||
throw cleanupAndThrow(p, ex);
|
||||
} catch (Exception ex) {
|
||||
throw cleanupAndThrow(p, new EOFException(ex.getMessage()));
|
||||
if (ex.getCause() instanceof IOException)
|
||||
throw cleanupAndThrow(p, (IOException) ex.getCause());
|
||||
else
|
||||
throw cleanupAndThrow(p, new EOFException(ex.getMessage()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -428,10 +431,14 @@ public class POP3Store extends Store {
|
|||
|
||||
// only the first supported and enabled mechanism is used
|
||||
logger.log(Level.FINE, "Using mechanism {0}", m);
|
||||
String msg =
|
||||
p.authenticate(m, host, authzid, user, passwd);
|
||||
if (msg != null)
|
||||
throw new AuthenticationFailedException(msg);
|
||||
try {
|
||||
String msg =
|
||||
p.authenticate(m, host, authzid, user, passwd);
|
||||
if (msg != null)
|
||||
throw new AuthenticationFailedException(msg);
|
||||
} catch (IOException ex) {
|
||||
throw new AuthenticationFailedException(m, ex);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ class Protocol {
|
|||
*/
|
||||
synchronized String authenticate(String mech,
|
||||
String host, String authzid,
|
||||
String user, String passwd) {
|
||||
String user, String passwd) throws IOException {
|
||||
Authenticator a = authenticators.get(mech.toUpperCase(Locale.ENGLISH));
|
||||
if (a == null)
|
||||
return "No such authentication mechanism: " + mech;
|
||||
|
@ -305,7 +305,7 @@ class Protocol {
|
|||
return "login failed";
|
||||
return null;
|
||||
} catch (IOException ex) {
|
||||
return ex.getMessage();
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue