Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MONDRIAN: Rename mondrian.resource.Error to ChainableError.
[git-p4: depot-paths = "//open/mondrian/": change = 156]
- Loading branch information
1 parent
803a908
commit 17690cb
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
// $Id$ | ||
// This software is subject to the terms of the Common Public License | ||
// Agreement, available at the following URL: | ||
// http://www.opensource.org/licenses/cpl.html. | ||
// (C) Copyright 2001-2002 Kana Software, Inc. and others. | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
// | ||
// jhyde, 3 December, 2001 | ||
*/ | ||
|
||
package mondrian.resource; | ||
|
||
import java.io.PrintStream; | ||
import java.io.PrintWriter; | ||
|
||
/** | ||
* An <code>Error</code> is an an error which can be constructed from a | ||
* resource and a set of arguments. It implements {@link ChainableThrowable}, | ||
* so can chain it to a previous error. | ||
* | ||
* @author jhyde | ||
* @since 3 December, 2001 | ||
* @version $Id$ | ||
**/ | ||
public class Error extends java.lang.Error implements ChainableThrowable | ||
{ | ||
private Throwable nextThrowable; | ||
private int code; | ||
|
||
public Error(Throwable err, Resource res, int code, Object[] args) | ||
{ | ||
super(res.formatError(code, args)); | ||
this.nextThrowable = err; | ||
this.code = code; | ||
} | ||
// implement ChainableThrowable | ||
public Throwable getNextThrowable() | ||
{ | ||
return nextThrowable; | ||
} | ||
public void setNextThrowable(Throwable err) | ||
{ | ||
nextThrowable = err; | ||
} | ||
public int getCode() | ||
{ | ||
return code; | ||
} | ||
// public String toString() { | ||
// return Util.toString(this); | ||
// } | ||
public void printStackTrace(PrintWriter s) { | ||
super.printStackTrace(s); | ||
if (nextThrowable != null) { | ||
nextThrowable.printStackTrace(s); | ||
} | ||
} | ||
public void printStackTrace(PrintStream s) { | ||
super.printStackTrace(s); | ||
if (nextThrowable != null) { | ||
nextThrowable.printStackTrace(s); | ||
} | ||
} | ||
} | ||
|
||
|
||
// End Error.java |