Skip to content

Commit

Permalink
MONDRIAN: Rename mondrian.resource.Error to ChainableError.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 156]
  • Loading branch information
julianhyde committed Sep 19, 2002
1 parent 803a908 commit 17690cb
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions src/main/mondrian/resource/ChainableError.java
@@ -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

0 comments on commit 17690cb

Please sign in to comment.