ex = ( (MessagingException) ex ).getNextException(); } else { ex = null;
t = ((MessagingException) t).getNextException(); } else { t = cause;
private boolean hasNestedMessagingException() { return messagingException.getNextException() != null && messagingException.getNextException() instanceof MessagingException; }
public Exception getNextException() { return exception.getNextException(); }
private Exception resolveException(MessagingException msgExc) { MessagingException me = msgExc; Exception nextException = null; Exception lastException = msgExc; while ((nextException = me.getNextException()) != null) { lastException = nextException; if (MessagingException.class.getCanonicalName().equals(nextException.getClass().getCanonicalName())) { me = (MessagingException) nextException; } else { break; } } return lastException; } }
public String getMessage() { Exception next = getNextException(); if (next == null) { return super.getMessage(); } else { return super.getMessage() + " (" + next.getClass().getName() + ": " + next.getMessage() + ")"; } } }
public String getMessage() { Exception next = getNextException(); if (next == null) { return super.getMessage(); } else { return super.getMessage() + " (" + next.getClass().getName() + ": " + next.getMessage() + ")"; } } }
public String getNestedExceptionMessage(MessagingException me) { if (me.getNextException() == null) { return sanitizeExceptionMessage(me); } else { Exception ex1 = me.getNextException(); return sanitizeExceptionMessage(ex1); } } }
/** Send the file with no filename, assuming you've already called * the setBody() method. */ public void sendFile() { try { // Finally, send the message! (use static Transport method) Transport.send(mesg); } catch (MessagingException ex) { while ((ex = (MessagingException)ex.getNextException()) != null) { ex.printStackTrace(); } } }
private MessagingException handleMessagingException(Mail mail, MessagingException me) throws MessagingException { LOGGER.debug("Exception delivering message ({}) - {}", mail.getName(), me.getMessage()); if ((me.getNextException() != null) && (me.getNextException() instanceof IOException)) { // If it's an IO exception with no nested exception, it's probably // some socket or weird I/O related problem. return me; } else { // This was not a connection or I/O error particular to one SMTP server of an MX set. Instead, it is almost // certainly a protocol level error. In this case we assume that this is an error we'd encounter with any of // the SMTP servers associated with this MX record, and we pass the exception to the code in the outer block // that determines its severity. throw me; } }
try { Properties props = new Properties(); props.put("mail.from", "one four four@@or.newer"); Session s = Session.getInstance(props); new MimeMessage(s).setFrom(); } catch (MessagingException me) { Throwable cause = me.getNextException(); if (cause == null) { System.err.println("JavaMail 1.4.3 or older."); } else if (cause instanceof AddressException) { System.err.println("JavaMail 1.4.4 or newer."); } else { me.printStackTrace(); } }
private EnhancedMessagingException getNestedMessagingException() { Preconditions.checkState(hasNestedMessagingException()); return new EnhancedMessagingException((MessagingException) messagingException.getNextException()); }
private void logLevels(MessagingException me) { Exception ne; while ((ne = me.getNextException()) != null && ne instanceof MessagingException) { me = (MessagingException) ne; EnhancedMessagingException enhancedMessagingException = new EnhancedMessagingException(me); if (me.getClass().getName().endsWith(".SMTPAddressFailedException") || me.getClass().getName().endsWith(".SMTPAddressSucceededException")) { LOGGER.debug("ADDRESS :[{}] Address:[{}] Command : [{}] RetCode[{}] Response [{}]", enhancedMessagingException.computeAction(), me, enhancedMessagingException.computeAddress(), enhancedMessagingException.computeCommand(), enhancedMessagingException.getReturnCode()); } } } }
e.printStackTrace(out); if (e instanceof MessagingException) { e = ((MessagingException)e).getNextException(); } else { e = null;
e.printStackTrace(out); if (e instanceof MessagingException) { e = ((MessagingException) e).getNextException(); } else { e = null;
protected void handleException(Task task, Exception rootException) { TaskDecorator theTask = (TaskDecorator) task; if (theTask.getExecutionCount() > retryCount) { errorQueue.addTask(theTask.getTask()); } else { failed.add(task); } if (rootException instanceof MessagingException) { Exception e = rootException; while (e instanceof MessagingException) { MessagingException me = (MessagingException) e; log.error(me.getMessage(), me); e = me.getNextException(); } } else log.error("Failed to execute task", rootException); }
if (((MessagingException) ex).getNextException() == null) { out.println(sanitizeExceptionMessage(ex)); } else { Exception ex1 = ((MessagingException) ex).getNextException(); if (ex1 instanceof SendFailedException) { out.println("Remote mail server told me: " + sanitizeExceptionMessage(ex1));
t = ((MessagingException) t).getNextException(); } else { t = cause;
logger.log(Level.FINE, "MessagingException while sending", mex); if (mex.getNextException() instanceof IOException) {
logger.log(Level.FINE, "MessagingException while sending", mex); if (mex.getNextException() instanceof IOException) {