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 | 0 | this(message, (Throwable)null); |
36 | 0 | } |
37 | |
|
38 | |
public WorkflowServiceErrorException(String message, Throwable throwable) { |
39 | 0 | super(message, throwable); |
40 | 0 | serviceErrors = new ArrayList(); |
41 | 0 | } |
42 | |
|
43 | |
public WorkflowServiceErrorException(String msg, WorkflowServiceError error) { |
44 | 0 | super(msg); |
45 | 0 | serviceErrors = new ArrayList(); |
46 | 0 | serviceErrors.add(error); |
47 | 0 | } |
48 | |
|
49 | |
public WorkflowServiceErrorException(String msg, Throwable t, WorkflowServiceError error) { |
50 | 0 | super(msg, t); |
51 | 0 | serviceErrors = new ArrayList(); |
52 | 0 | serviceErrors.add(error); |
53 | 0 | } |
54 | |
|
55 | |
|
56 | |
public WorkflowServiceErrorException(String msg, Collection errors) { |
57 | 0 | super(msg); |
58 | 0 | setServiceErrors(errors); |
59 | 0 | } |
60 | |
|
61 | |
public Collection getServiceErrors() { |
62 | 0 | return serviceErrors; |
63 | |
} |
64 | |
|
65 | |
public void setServiceErrors(Collection serviceErrors) { |
66 | 0 | this.serviceErrors = serviceErrors; |
67 | 0 | } |
68 | |
|
69 | |
public String toString() { |
70 | 0 | if (serviceErrors != null) { |
71 | 0 | return super.toString() + " " + serviceErrors; |
72 | |
} else { |
73 | 0 | return super.toString() + " (no service errors)"; |
74 | |
} |
75 | |
} |
76 | |
} |