/*
 * COPYRIGHT (c) 1998-1999 Jan-Henrik Haukeland, http://www.tildeslash.com/
 */

package ts.mail;

import java.lang.Exception ;

import ts.mail.MailModel;

/**
 * Thrown to indicate that there is an error in the underlying protocol, 
 * such as a POP3 error. 
 * 
 * @author  Jan-Henrik Haukeland &lt;hauk@tildeslash.com&gt;
 * @version $Id: GetMailException.java,v 1.4 1999/02/21 08:47:13 hauk Exp $
 */ 
public class GetMailException extends Exception 
{
  
  public static final int OK        =  0,
                          WARNING   =  1,
                          ERROR     =  2,
                          FATAL     =  4;
  
  private  int            myStatus;
  private  MailModel      myMailModel; 


  /**
   * Store status and message. Legal values for status 
   * are public constants in this class.
   */
  public GetMailException( int status, String message) 
  {
    super(message);
    myStatus = status;
  }

  
  /**
   * Store status, message and the mail that was processed. 
   */
  public GetMailException( int status, String message, MailModel aMail) 
  {
    this( status, message );
    myMailModel= aMail;
  }


  /** 
   * @return status.
   */
  public int getStatus() 
  {
    return myStatus;
  }


  /** 
   * @return mail
   */
  public MailModel getMail() 
  {
    return myMailModel;
  }

}
