KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > indexing > StoreException


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.indexing;
12
13 import java.io.PrintStream JavaDoc;
14 import java.io.PrintWriter JavaDoc;
15
16 public abstract class StoreException extends Exception JavaDoc {
17     protected Throwable JavaDoc wrappedException;
18
19     public StoreException(String JavaDoc message) {
20         super(message);
21     }
22
23     public StoreException(String JavaDoc message, Throwable JavaDoc wrappedException) {
24         super(message);
25         this.wrappedException = wrappedException;
26     }
27
28     /**
29      * Prints a stack trace out for the exception.
30      */

31     public void printStackTrace() {
32         printStackTrace(System.err);
33     }
34
35     /**
36      * Prints a stack trace out for the exception.
37      */

38     public void printStackTrace(PrintStream JavaDoc output) {
39         synchronized (output) {
40             super.printStackTrace(output);
41             if (wrappedException != null)
42                 wrappedException.printStackTrace(output);
43         }
44     }
45
46     /**
47      * Prints a stack trace out for the exception.
48      */

49     public void printStackTrace(PrintWriter JavaDoc output) {
50         synchronized (output) {
51             super.printStackTrace(output);
52             if (wrappedException != null)
53                 wrappedException.printStackTrace(output);
54         }
55     }
56
57 }
58
59
Popular Tags