Merge pull request #3808 from artbristol/remove-exception-todo

Remove TODO
This commit is contained in:
Vincent Breitmoser 2018-12-10 12:55:12 +01:00 committed by GitHub
commit d1c4701256
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 13 deletions

View file

@ -28,9 +28,4 @@ public class MessagingException extends Exception {
return permanentFailure;
}
//TODO setters in Exception are bad style, remove (it's nearly unused anyway)
public void setPermanentFailure(boolean permanentFailure) {
this.permanentFailure = permanentFailure;
}
}

View file

@ -565,10 +565,10 @@ public class Pop3Folder extends Folder<Pop3Message> {
Integer msgNum = uidToMsgNumMap.get(message.getUid());
if (msgNum == null) {
MessagingException me = new MessagingException("Could not delete message " + message.getUid()
+ " because no msgNum found; permanent error");
me.setPermanentFailure(true);
throw me;
throw new MessagingException(
"Could not delete message " + message.getUid() + " because no msgNum found; permanent error",
true
);
}
open(Folder.OPEN_MODE_RW);
connection.executeSimpleCommand(String.format(DELE_COMMAND + " %s", msgNum));

View file

@ -452,10 +452,7 @@ public class SmtpTransport extends Transport {
} catch (NegativeSmtpReplyException e) {
throw e;
} catch (Exception e) {
MessagingException me = new MessagingException("Unable to send message", e);
me.setPermanentFailure(entireMessageSent);
throw me;
throw new MessagingException("Unable to send message", entireMessageSent, e);
} finally {
close();
}