]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/Common/org/tianocore/common/exception/EdkException.java
moved exception and logger classes to org.tianocore.common package; and created defin...
[mirror_edk2.git] / Tools / Source / Common / org / tianocore / common / exception / EdkException.java
diff --git a/Tools/Source/Common/org/tianocore/common/exception/EdkException.java b/Tools/Source/Common/org/tianocore/common/exception/EdkException.java
new file mode 100644 (file)
index 0000000..bd143d8
--- /dev/null
@@ -0,0 +1,48 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+  EdkException.java\r
+\r
+Abstract:\r
+\r
+--*/\r
+package org.tianocore.exception;\r
+\r
+public class EdkException extends Exception {\r
+    static final long serialVersionUID = -8494188017252114029L;\r
+    private StackTraceElement[] stackTrace;\r
+    public static boolean isPrintStack = false;\r
+\r
+    public EdkException(String message) {\r
+        super("[EdkException]:" + message);\r
+    }\r
+\r
+    public EdkException(String message, boolean traceStack) {\r
+        super(message);\r
+        \r
+    }\r
+    \r
+    public EdkException(){\r
+        super();\r
+    }\r
+    \r
+    public EdkException(Exception e, String message){\r
+        super("[EdkException]:" + message);\r
+        if (isPrintStack){\r
+            this.setStackTrace(e.getStackTrace());\r
+        }\r
+        e.printStackTrace();\r
+    }\r
+    public static void setIsprintStack (boolean flag){\r
+        isPrintStack = flag;\r
+    }\r
+}\r