home *** CD-ROM | disk | FTP | other *** search
- package com.netscape.javascript;
-
- import java.lang.reflect.InvocationTargetException;
-
- public class WrappedException extends EvaluatorException implements Wrapper {
- private Throwable exception;
-
- public WrappedException(Throwable var1) {
- super(var1.getMessage());
- this.exception = var1.fillInStackTrace();
- }
-
- public String getMessage() {
- return "WrappedException of " + this.exception.toString();
- }
-
- public static EvaluatorException wrapException(Throwable var0) {
- if (var0 instanceof InvocationTargetException) {
- var0 = ((InvocationTargetException)var0).getTargetException();
- }
-
- return (EvaluatorException)(var0 instanceof EvaluatorException ? (EvaluatorException)var0 : new WrappedException(var0));
- }
-
- public String getLocalizedMessage() {
- return "WrappedException of " + this.exception.getLocalizedMessage();
- }
-
- public Object unwrap() {
- return this.exception;
- }
-
- public Throwable getWrappedException() {
- return this.exception;
- }
- }
-