comparison dwt/DWTError.d @ 206:cca980503056

sync with dwt-linux, removed the simple.d
author Frank Benoit <benoit@tionex.de>
date Wed, 16 Apr 2008 20:36:50 +0200
parents dc7db4338dbe
children ab60f3309436
comparison
equal deleted inserted replaced
205:6d1762e7ebb7 206:cca980503056
42 * @see DWTException 42 * @see DWTException
43 * @see DWT#error(int) 43 * @see DWT#error(int)
44 */ 44 */
45 45
46 public class DWTError : PlatformException { 46 public class DWTError : PlatformException {
47
48 /** 47 /**
49 * The DWT error code, one of DWT.ERROR_*. 48 * The DWT error code, one of DWT.ERROR_*.
50 */ 49 */
51 public int code; 50 public int code;
52 51
53 /** 52 /**
54 * The underlying throwable that caused the problem, 53 * The underlying throwable that caused the problem,
55 * or null if this information is not available. 54 * or null if this information is not available.
56 */ 55 */
57 public Exception throwable; 56 public Exception throwable( Exception e ){
57 this.next = e;
58 return this.next;
59 }
60 public Exception throwable(){
61 return this.next;
62 }
58 63
59 //static final long serialVersionUID = 3833467327105808433L; 64 //static final long serialVersionUID = 3833467327105808433L;
60 65
61 /** 66 /**
62 * Constructs a new instance of this class with its 67 * Constructs a new instance of this class with its
127 * </p> 132 * </p>
128 * @return the error message string of this DWTError object 133 * @return the error message string of this DWTError object
129 */ 134 */
130 public char[] getMessage () { 135 public char[] getMessage () {
131 if (throwable is null) 136 if (throwable is null)
132 return super.toString (); 137 return super.toString();
133 return super.toString () ~ " (" ~ throwable.toString () ~ ")"; //$NON-NLS-1$ //$NON-NLS-2$ 138 return super.toString () ~ " (" ~ throwable.toString () ~ ")"; //$NON-NLS-1$ //$NON-NLS-2$
134 } 139 }
135 140
136 /** 141 /**
137 * Outputs a printable representation of this error's 142 * Outputs a printable representation of this error's
150 Stderr.formatln ("*** Stack trace of contained error ***"); //$NON-NLS-1$ 155 Stderr.formatln ("*** Stack trace of contained error ***"); //$NON-NLS-1$
151 foreach( msg; throwable.info ){ 156 foreach( msg; throwable.info ){
152 Stderr.formatln( "{}", msg ); 157 Stderr.formatln( "{}", msg );
153 } 158 }
154 } 159 }
160 }
155 161
156 } 162 }
157 }
158
159
160