1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.rice.kew.exception;
17  
18  import java.util.ArrayList;
19  import java.util.Collection;
20  
21  
22  
23  
24  
25  
26  
27  
28  public class WorkflowServiceErrorException extends RuntimeException {
29  
30  
31  	private static final long serialVersionUID = 2457592489303923040L;
32  	private Collection serviceErrors;
33      
34      public WorkflowServiceErrorException(String message) {
35          this(message, (Throwable)null);
36      }
37      
38      public WorkflowServiceErrorException(String message, Throwable throwable) {
39          super(message, throwable);
40          serviceErrors = new ArrayList();
41      }
42      
43      public WorkflowServiceErrorException(String msg, WorkflowServiceError error) {
44          super(msg);
45          serviceErrors = new ArrayList();
46          serviceErrors.add(error);
47      }
48  
49          public WorkflowServiceErrorException(String msg, Throwable t, WorkflowServiceError error) {
50          super(msg, t);
51          serviceErrors = new ArrayList();
52          serviceErrors.add(error);
53      }
54      
55      
56      public WorkflowServiceErrorException(String msg, Collection errors) {
57          super(msg);
58          setServiceErrors(errors);
59      }
60      
61      public Collection getServiceErrors() {
62          return serviceErrors;
63      }
64  
65      public void setServiceErrors(Collection serviceErrors) {
66          this.serviceErrors = serviceErrors;
67      }
68  
69      public String toString() {
70          if (serviceErrors != null) {
71              return super.toString() + " " + serviceErrors;    
72          } else {
73              return super.toString() + " (no service errors)";
74          }
75      }
76  }