1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.fatwire.gst.foundation.facade.runtag;
18
19 import COM.FutureTense.Interfaces.FTValList;
20 import COM.FutureTense.Util.ftErrors;
21
22 import com.fatwire.gst.foundation.CSRuntimeException;
23
24
25
26
27
28
29 public class TagRunnerRuntimeException extends CSRuntimeException {
30 private final String pageName;
31 private final String elementName;
32 private final FTValList arguments;
33 private static final long serialVersionUID = 5392042951880858120L;
34
35
36
37
38
39 public TagRunnerRuntimeException(String msg, int errno, final FTValList arguments) {
40 this(msg, errno, arguments, null, null, null);
41 }
42
43 public TagRunnerRuntimeException(String msg, int errno, final FTValList arguments, ftErrors complexError,
44 String pagename, String elementname) {
45 super(msg, complexError, errno);
46 this.arguments = arguments;
47 this.pageName = pagename;
48 this.elementName = elementname;
49 }
50
51
52
53
54
55 public String getPageName() {
56 return pageName;
57 }
58
59
60
61
62
63 public String getElementName() {
64 return elementName;
65 }
66
67 public FTValList getArguments() {
68 return arguments;
69 }
70
71 @Override
72 public String getMessage() {
73 StringBuilder builder = new StringBuilder();
74 builder.append(super.getMessage());
75 builder.append("|");
76 builder.append(arguments);
77 builder.append("|");
78 builder.append(getPageName());
79 builder.append("|");
80 builder.append(getElementName());
81 if (getComplexError() != null) {
82 builder.append("|");
83 builder.append("reason: ").append(getComplexError().getReason());
84 builder.append("|message: ");
85 builder.append(getComplexError().getMessage());
86
87 int details = getComplexError().details();
88 if (details > 0) {
89 builder.append("|");
90 }
91 for (int i = 0; i < details; i++) {
92 builder.append(" ");
93 builder.append(getComplexError().detail(i));
94 }
95 }
96 return builder.toString();
97 }
98 }