diff options
author | Rich Hickey <richhickey@gmail.com> | 2007-10-30 00:14:34 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2007-10-30 00:14:34 +0000 |
commit | c5542c2946f3ebdb81840c47d2134200a79ab332 (patch) | |
tree | efd9e9e9ecc56a52ab8207b5727477970f661d9e /src | |
parent | c2eec89e260d5d4ccfe6b722498c7a3fa22aa080 (diff) |
Limited exception wrappers to one level
Diffstat (limited to 'src')
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index 249c1411..3f630cbf 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -2584,6 +2584,13 @@ private static Expr analyze(C context, Object form, String name) throws Exceptio return new QuoteExpr(form); } +static public class CompilerException extends Exception{ + + public CompilerException(String message, Throwable cause){ + super(message, cause); + } +} + private static Expr analyzeSeq(C context, ISeq form, String name) throws Exception{ Integer line = (Integer) LINE.get(); try @@ -2612,8 +2619,11 @@ private static Expr analyzeSeq(C context, ISeq form, String name) throws Excepti } catch(Throwable e) { - throw new Exception(String.format("%s:%d: %s", SOURCE.get(), (Integer) LINE.get(), e.getMessage()), + if(!(e instanceof CompilerException)) + throw new CompilerException(String.format("%s:%d: %s", SOURCE.get(), (Integer) LINE.get(), e.getMessage()), e); + else + throw (CompilerException)e; } finally { |