// Path: src/main/java/colossal/pipe/PhaseError.java
// public class PhaseError {
//     private String message;
//     private Throwable exception;
//     
//     public PhaseError(String message) {
//         this.message = message;
//         this.exception = null;
//     }
//     public PhaseError(Throwable t, String processName) {
//         this.message = "Failure running "+processName;
//         this.exception = t;
//     }
//     public String getMessage() {
//         return message;
//     }
//     public Throwable getException() {
//         return exception;
//     }
// }


import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
import colossal.pipe.PhaseError;
            SimpleEmail email = makeFailureEmail();
            StringBuilder msg = new StringBuilder(summary);
            msg.append("Exception:\n");
            StringWriter writer = new StringWriter();
            PrintWriter printWriter = new PrintWriter(writer);
            exception.printStackTrace(printWriter);
            msg.append(writer.toString());
            email.setMsg(msg.toString());
            email.send();
        } catch (EmailException e) {
            System.err.println("Can't send email!");
            e.printStackTrace();
        }
    }

    private SimpleEmail makeFailureEmail() throws EmailException {
        return makeEmail("Job Failure");
    }
    
    private SimpleEmail makeEmail(String title) throws EmailException {
        SimpleEmail email = new SimpleEmail();
        for (String targetAddress : targetAddresses)
            email.addTo(targetAddress);            
        email.setSubject(title);
        email.setFrom(from);
        email.setHostName(host);
        return email;
    }

    @Override
// Path: src/main/java/colossal/pipe/PhaseError.java
// public class PhaseError {
//     private String message;
//     private Throwable exception;
//     
//     public PhaseError(String message) {
//         this.message = message;
//         this.exception = null;
//     }
//     public PhaseError(Throwable t, String processName) {
//         this.message = "Failure running "+processName;
//         this.exception = t;
//     }
//     public String getMessage() {
//         return message;
//     }
//     public Throwable getException() {
//         return exception;
//     }
// }


// Path: src/main/java/colossal/util/EmailAlerter.java
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;
import colossal.pipe.PhaseError;

            SimpleEmail email = makeFailureEmail();
            StringBuilder msg = new StringBuilder(summary);
            msg.append("Exception:\n");
            StringWriter writer = new StringWriter();
            PrintWriter printWriter = new PrintWriter(writer);
            exception.printStackTrace(printWriter);
            msg.append(writer.toString());
            email.setMsg(msg.toString());
            email.send();
        } catch (EmailException e) {
            System.err.println("Can't send email!");
            e.printStackTrace();
        }
    }

    private SimpleEmail makeFailureEmail() throws EmailException {
        return makeEmail("Job Failure");
    }
    
    private SimpleEmail makeEmail(String title) throws EmailException {
        SimpleEmail email = new SimpleEmail();
        for (String targetAddress : targetAddresses)
            email.addTo(targetAddress);            
        email.setSubject(title);
        email.setFrom(from);
        email.setHostName(host);
        return email;
    }

    @Override
    public void alert(List<PhaseError> errors) {