1 package org.codehaus.groovy; 2 3 public class GroovyBugError extends AssertionError  4 { 5 private String message; 6 private Exception exception; 7 8 public GroovyBugError( String message ) 9 { 10 this.message = message; 11 } 12 13 public GroovyBugError( Exception exception ) 14 { 15 this.exception = exception; 16 } 17 18 public String toString() 19 { 20 return getMessage(); 21 } 22 23 public String 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 getCause() 37 { 38 return this.exception; 39 } 40 } 41 | Popular Tags |