1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 20 package org.apache.geronimo.javamail.transport.smtp; 21 22 import javax.mail.Address; 23 import javax.mail.SendFailedException; 24 25 public class SMTPSendFailedException extends SendFailedException { 26 // the failing command 27 protected String cmd; 28 29 // the error code for the failure 30 protected int rc; 31 32 /** 33 * Constructor for an SMTPSendFaileException. 34 * 35 * @param cmd 36 * The failing command string. 37 * @param rc 38 * The error code for the failing command. 39 * @param err 40 * An error message for the exception. 41 * @param ex 42 * Any associated nested exception. 43 * @param vs 44 * An array of valid, sent addresses. 45 * @param vus 46 * An array of addresses that were valid, but were unsent. 47 * @param inv 48 * An array of addresses deemed invalid. 49 */ 50 SMTPSendFailedException(java.lang.String cmd, int rc, java.lang.String err, java.lang.Exception ex, Address[] vs, 51 Address[] vus, Address[] inv) { 52 super(err, ex, vs, vus, inv); 53 this.cmd = cmd; 54 this.rc = rc; 55 } 56 57 /** 58 * Get the failing command string for the exception. 59 * 60 * @return The string value of the failing command. 61 */ 62 public String getCommand() { 63 return cmd; 64 } 65 66 /** 67 * The failing command return code. 68 * 69 * @return The failure return code. 70 */ 71 public int getReturnCode() { 72 return rc; 73 } 74 }