1
2
3
4
5
6
7
8
9
10
11 public class XmlPullParserException extends Exception {
12
13
14
15 @Deprecated
16 protected Throwable detail;
17
18 protected int row = -1;
19
20 protected int column = -1;
21
22
23
24
25
26 public XmlPullParserException(String s) {
27 super(s);
28 }
29
30
31
32
33
34
35 public XmlPullParserException(String msg, XmlPullParser parser, Throwable chain) {
36 super(
37 (msg == null ? "" : msg + " ")
38 + (parser == null ? "" : "(position:" + parser.getPositionDescription() + ") ")
39 + (chain == null ? "" : "caused by: " + chain),
40 chain);
41
42 if (parser != null) {
43 this.row = parser.getLineNumber();
44 this.column = parser.getColumnNumber();
45 }
46 this.detail = chain;
47 }
48
49
50
51
52
53 @Deprecated
54 public Throwable getDetail() {
55 return getCause();
56 }
57
58
59 public int getLineNumber() {
60 return row;
61 }
62
63 public int getColumnNumber() {
64 return column;
65 }
66
67
68
69
70
71
72
73 @Override
74 public void printStackTrace() {
75 if (getCause() == null) {
76 super.printStackTrace();
77 } else {
78 synchronized (System.err) {
79 System.err.println(super.getMessage() + "; nested exception is:");
80 getCause().printStackTrace();
81 }
82 }
83 }
84 }