1 package org.codehaus.groovy.control.messages; 2 3 import java.io.PrintWriter ; 4 5 import org.codehaus.groovy.control.Janitor; 6 import org.codehaus.groovy.control.ProcessingUnit; 7 8 9 10 17 18 public class ExceptionMessage extends Message 19 { 20 private Exception cause = null; 22 23 public ExceptionMessage( Exception cause ) 24 { 25 this.cause = cause; 26 } 27 28 29 30 33 34 public Exception getCause() 35 { 36 return this.cause; 37 } 38 39 40 41 44 45 public void write( PrintWriter output, ProcessingUnit context, Janitor janitor ) 46 { 47 String description = "General error during " + context.getPhaseDescription() + ": "; 48 49 String message = cause.getMessage(); 50 if( message != null ) 51 { 52 output.println( description + message ); 53 } 54 else 55 { 56 output.println( description + cause ); 57 } 58 output.println(""); 59 } 60 61 62 } 63 64 65 66 | Popular Tags |