Mercurial > projects > dwt2
annotate java/src/java/lang/exceptions.d @ 21:9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 19 Mar 2009 20:38:55 +0100 |
parents | f36c67707cb3 |
children | f589fc20a5f9 |
rev | line source |
---|---|
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 module java.lang.exceptions; |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 import java.lang.util; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
4 import java.lang.String; |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
6 version(Tango){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
7 static import tango.core.Exception; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
8 public alias tango.core.Exception.IllegalArgumentException IllegalArgumentException; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
9 public alias tango.core.Exception.IOException IOException; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
10 public alias tango.core.Exception.PlatformException PlatformException; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
11 public alias tango.core.Exception.ArrayBoundsException ArrayIndexOutOfBoundsException; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
12 public alias tango.core.Exception.NoSuchElementException NoSuchElementException; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
13 public alias tango.core.Exception.UnicodeException UnicodeException; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
14 alias Exception Throwable; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
15 } else { // Phobos |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
16 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
17 static import core.exception; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
18 public alias core.exception.RangeError ArrayIndexOutOfBoundsException; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
19 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
20 class IllegalArgumentException : Exception { |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
21 this( String e = null ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
22 super(e); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
23 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
24 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
25 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
26 class IOException : Exception { |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
27 this( String e = null ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
28 super(e); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
29 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
30 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
31 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
32 class NoSuchElementException : Exception { |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
33 this( String e = null ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
34 super(e); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
35 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
36 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
37 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
38 class UnicodeException : Exception { |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
39 this( String msg, int idx){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
40 super( "" ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
41 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
42 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
43 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
44 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
45 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
46 class InternalError : Exception { |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
47 this( String file, long line, String e = null ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
48 super(e); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
49 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
50 } |
6
f36c67707cb3
Removed import to tango.core.Exception
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
51 |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
52 class ClassCastException : Exception { |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
53 this( String e = null ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
54 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
55 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
56 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
57 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
58 class IllegalStateException : Exception { |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
59 this( String e = null ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
62 this( Exception e ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 super(e.toString); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 class IndexOutOfBoundsException : Exception { |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 this( String e = null){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 class InterruptedException : Exception { |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
74 this( String e = null ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
75 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
76 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
77 this( Exception e ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 super(e.toString); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
79 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
80 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
81 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
82 class NullPointerException : Exception { |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
83 this( String e = null ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
84 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
85 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
86 this( Exception e ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
87 super(e.toString); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
88 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
89 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
90 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
91 class NumberFormatException : IllegalArgumentException { |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
92 this( String e ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
94 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
95 this( Exception e ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
96 super(e.toString); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
97 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
98 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
99 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
100 class RuntimeException : Exception { |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
101 this( String file, long line, String msg = null){ |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
102 super( msg, file, line ); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
103 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
104 this( String e = null){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
105 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
106 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
107 this( Exception e ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
108 super(e.toString); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
109 next = e; |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 } |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
111 public Throwable getCause() { |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
112 return next; // D2 has next of type Throwable |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
113 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
114 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
115 |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
116 class UnsupportedOperationException : RuntimeException { |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
117 this( String e = null){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
118 super(e); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
119 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
120 this( Exception e ){ |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
121 super(e.toString); |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
122 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
123 } |
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
124 |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
125 /// Extension to the D Exception |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
126 String ExceptionGetLocalizedMessage( Exception e ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
127 return e.msg; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
128 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
129 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
130 /// Extension to the D Exception |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
131 void ExceptionPrintStackTrace( Exception e ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
132 ExceptionPrintStackTrace( e, & getDwtLogger().error ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
133 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
134 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
135 /// Extension to the D Exception |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
136 void ExceptionPrintStackTrace( Throwable e, void delegate ( String file, ulong line, String fmt, ... ) dg ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
137 Throwable exception = e; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
138 while( exception !is null ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
139 dg( exception.file, exception.line, "Exception in {}({}): {}", exception.file, exception.line, exception.msg ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
140 if( exception.info !is null ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
141 foreach( msg; exception.info ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
142 dg( exception.file, exception.line, "trc {}", msg ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
143 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
144 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
145 exception = exception.next; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
146 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
147 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
148 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
149 void PrintStackTrace( int deepth = 100, String prefix = "trc" ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
150 auto e = new Exception( null ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
151 int idx = 0; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
152 const start = 3; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
153 foreach( msg; e.info ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
154 if( idx >= start && idx < start+deepth ) { |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
155 getDwtLogger().trace( __FILE__, __LINE__, "{}: {}", prefix, msg ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
156 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
157 idx++; |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
158 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
6
diff
changeset
|
159 } |