annotate base/src/java/lang/exceptions.d @ 27:1bf55a6eb092

Renamed java tree to base
author Frank Benoit <benoit@tionex.de>
date Sat, 21 Mar 2009 11:33:57 +0100
parents java/src/java/lang/exceptions.d@f589fc20a5f9
children 66be6a990713
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 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 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
107 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
108 super( msg, file, line );
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 this( String e = null){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
111 super(e);
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( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 super(e.toString);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
115 next = e;
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
116 }
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
117 public Throwable getCause() {
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
118 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
119 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
120 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
121
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 class UnsupportedOperationException : RuntimeException {
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 this( String e = null){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 super(e);
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 this( Exception e ){
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127 super(e.toString);
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 }
712ffca654f3 Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130
21
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
131 /// 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
132 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
133 return e.msg;
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
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
136 /// 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
137 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
138 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
139 }
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 /// 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
142 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
143 Throwable exception = e;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
144 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
145 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
146 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
147 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
148 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
149 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
150 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
151 exception = exception.next;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
152 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
153 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
154
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
155 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
156 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
157 int idx = 0;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
158 const start = 3;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
159 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
160 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
161 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
162 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
163 idx++;
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
164 }
9b96950f2c3c the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents: 6
diff changeset
165 }