1 package edu.asu.cri.MirkE.exceptions; 2 3 import java.io.PrintStream; 4 5 /*** 6 * This class is exception class for menu related exception 7 * 8 * @author Siva B.S.D.S 9 * @version $Id: MenuException.java,v 1.1 2005/02/22 16:35:17 smenor Exp $ 10 */ 11 public class MenuException extends Exception 12 { 13 /*** 14 * Comment for <code>serialVersionUID</code> 15 */ 16 private static final long serialVersionUID = 3258415045003260985L; 17 /*** 18 * Caused by exception if any 19 */ 20 private Throwable causedBy = null; 21 22 /*** 23 * Constructor accepting the message 24 * 25 * @param message Message 26 */ 27 public MenuException(String message) 28 { 29 super(message); 30 } 31 32 /*** 33 * Construct accepting the message and the caused by exception 34 * 35 * @param message Message 36 * @param causedByArg Causedby exception 37 */ 38 public MenuException(String message, Throwable causedByArg) 39 { 40 super(message); 41 causedBy = causedByArg; 42 } 43 44 /*** 45 * Constructor accepting the caused by exception 46 * 47 * @param causedByArg Caused by exception 48 */ 49 public MenuException(Throwable causedByArg) 50 { 51 super(causedByArg.getMessage()); 52 causedBy = causedByArg; 53 } 54 55 /*** 56 * Overloading the print stacktrace so that it will print the stack trace 57 * of causedby exception also 58 * 59 * @param out 60 */ 61 public void printStackTrace(PrintStream out) 62 { 63 causedBy.printStackTrace(out); 64 super.printStackTrace(out); 65 } 66 }