annotate base/src/java/lang/exceptions.d @ 84:fcf926c91ca4

Added base classes
author Frank Benoit <benoit@tionex.de>
date Sat, 18 Apr 2009 09:25:29 +0200
parents 66be6a990713
children 48d4ee626868
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
26
f589fc20a5f9 work on linux phobos
Frank Benoit <benoit@tionex.de>
parents: 21
diff changeset
20 class PlatformException : Exception {
f589fc20a5f9 work on linux phobos
Frank Benoit <benoit@tionex.de>
parents: 21
diff changeset
21 this( String e = null ){
f589fc20a5f9 work on linux phobos
Frank Benoit <benoit@tionex.de>
parents: 21
diff changeset
22 super(e);
f589fc20a5f9 work on linux phobos
Frank Benoit <benoit@tionex.de>
parents: 21
diff changeset
23 }
f589fc20a5f9 work on linux phobos
Frank Benoit <benoit@tionex.de>
parents: 21
diff changeset
24 }
f589fc20a5f9 work on linux phobos
Frank Benoit <benoit@tionex.de>
parents: 21
diff changeset
25
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
26 class IllegalArgumentException : 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 IOException : 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 NoSuchElementException : 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 e = null ){
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
40 super(e);
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 class UnicodeException : Exception {
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
45 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
46 super( "" );
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
47 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
48 }
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 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
51
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
52 class InternalError : Exception {
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
53 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
54 super(e);
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
55 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
56 }
6
f36c67707cb3 Removed import to tango.core.Exception
Frank Benoit <benoit@tionex.de>
parents: 2
diff changeset
57
2
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 class ClassCastException : 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 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 class IllegalStateException : Exception {
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65 this( String e = null ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 super(e);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68 this( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 super(e.toString);
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 IndexOutOfBoundsException : 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 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79 class InterruptedException : Exception {
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 this( String e = null ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 super(e);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83 this( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84 super(e.toString);
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 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
87
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
88 class NullPointerException : Exception {
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89 this( String e = null ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 super(e);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
91 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
92 this( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
93 super(e.toString);
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 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
96
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
97 class NumberFormatException : IllegalArgumentException {
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
98 this( String e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
99 super(e);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
100 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
101 this( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102 super(e.toString);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
103 }
84
fcf926c91ca4 Added base classes
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
104 public String getMessage(){
fcf926c91ca4 Added base classes
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
105 return msg;
fcf926c91ca4 Added base classes
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
106 }
2
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
108
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109 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
110 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
111 super( msg, file, line );
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
112 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
113 this( String e = null){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 super(e);
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 this( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
117 super(e.toString);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 next = e;
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 }
84
fcf926c91ca4 Added base classes
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
120 public String getMessage(){
fcf926c91ca4 Added base classes
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
121 return msg;
fcf926c91ca4 Added base classes
Frank Benoit <benoit@tionex.de>
parents: 60
diff changeset
122 }
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
123 public Throwable getCause() {
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
124 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
125 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128 class UnsupportedOperationException : RuntimeException {
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 this( String e = null){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130 super(e);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 this( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133 super(e.toString);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
134 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
135 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
136
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
137 /// 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
138 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
139 return e.msg;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
140 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
141
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
142 /// 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
143 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
144 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
145 }
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 /// 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
148 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
149 Throwable exception = e;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
150 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
151 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
152 if( exception.info !is null ){
60
66be6a990713 new eclipsetools target, fix of new exception stacktrace info.
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
153 foreach( frame; exception.info ){
66be6a990713 new eclipsetools target, fix of new exception stacktrace info.
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
154 dg( exception.file, exception.line, "trc {} {}", frame.file, frame.line );
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
155 }
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 exception = exception.next;
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 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
160
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
161 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
162 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
163 int idx = 0;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
164 const start = 3;
60
66be6a990713 new eclipsetools target, fix of new exception stacktrace info.
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
165 foreach( frame; e.info ){
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
166 if( idx >= start && idx < start+deepth ) {
60
66be6a990713 new eclipsetools target, fix of new exception stacktrace info.
Frank Benoit <benoit@tionex.de>
parents: 27
diff changeset
167 getDwtLogger().trace( __FILE__, __LINE__, "{} {}: {}", prefix, frame.file, frame.line );
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
168 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
169 idx++;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
170 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
171 }