1 25 package org.ofbiz.base.start; 26 27 import java.io.PrintStream ; 28 import java.io.PrintWriter ; 29 30 37 public class StartupException extends Exception { 38 39 Throwable nested = null; 40 41 44 public StartupException() { 45 super(); 46 } 47 48 52 public StartupException(String msg) { 53 super(msg); 54 } 55 56 60 public StartupException(String msg, Throwable nested) { 61 super(msg); 62 this.nested = nested; 63 } 64 65 69 public StartupException(Throwable nested) { 70 super(); 71 this.nested = nested; 72 } 73 74 75 public String getMessage() { 76 if (nested != null) { 77 return super.getMessage() + " (" + nested.getMessage() + ")"; 78 } else { 79 return super.getMessage(); 80 } 81 } 82 83 84 public String getNonNestedMessage() { 85 return super.getMessage(); 86 } 87 88 89 public Throwable getNested() { 90 if (nested == null) { 91 return this; 92 } 93 return nested; 94 } 95 96 97 public void printStackTrace() { 98 super.printStackTrace(); 99 if (nested != null) { 100 nested.printStackTrace(); 101 } 102 } 103 104 105 public void printStackTrace(PrintStream ps) { 106 super.printStackTrace(ps); 107 if (nested != null) { 108 nested.printStackTrace(ps); 109 } 110 } 111 112 113 public void printStackTrace(PrintWriter pw) { 114 super.printStackTrace(pw); 115 if (nested != null) { 116 nested.printStackTrace(pw); 117 } 118 } 119 } 120 | Popular Tags |