]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/Common/org/tianocore/exception/EdkException.java
Add log and exception mechanism
[mirror_edk2.git] / Tools / Source / Common / org / tianocore / exception / EdkException.java
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13 EdkException.java
14
15 Abstract:
16
17 --*/
18 package org.tianocore.exception;
19
20 public class EdkException extends Exception {
21 private StackTraceElement[] stackTrace;
22 public static boolean isPrintStack = false;
23
24 public EdkException(String message) {
25 super("[EdkException]:" + message);
26 }
27
28 public EdkException(String message, boolean traceStack) {
29 super(message);
30
31 }
32
33 public EdkException(){
34 super();
35 }
36
37 public EdkException(Exception e, String message){
38 super("[EdkException]:" + message);
39 if (isPrintStack){
40 this.setStackTrace(e.getStackTrace());
41 }
42 e.printStackTrace();
43 }
44 public static void setIsprintStack (boolean flag){
45 isPrintStack = flag;
46 }
47 }