KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > groovy > GroovyBugError


1 package org.codehaus.groovy;
2
3 public class GroovyBugError extends AssertionError JavaDoc
4 {
5     private String JavaDoc message;
6     private Exception JavaDoc exception;
7
8     public GroovyBugError( String JavaDoc message )
9     {
10         this.message = message;
11     }
12     
13     public GroovyBugError( Exception JavaDoc exception )
14     {
15         this.exception = exception;
16     }
17
18     public String JavaDoc toString()
19     {
20         return getMessage();
21     }
22
23     public String JavaDoc getMessage()
24     {
25         if( message != null )
26         {
27             return message;
28         }
29         else
30         {
31             return "UNCAUGHT EXCEPTION: " + exception.getMessage();
32         }
33     }
34     
35     
36     public Throwable JavaDoc getCause()
37     {
38         return this.exception;
39     }
40 }
41
Popular Tags