comparison dwt/DWTError.d @ 361:4bffbf81e2d6

redirect direct prints to DwtLogger
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Mar 2009 21:00:06 +0100
parents c0d810de7093
children
comparison
equal deleted inserted replaced
360:ee1dd551f5b1 361:4bffbf81e2d6
15 import dwt.dwthelper.utils; 15 import dwt.dwthelper.utils;
16 16
17 import dwt.DWT; 17 import dwt.DWT;
18 18
19 import tango.core.Exception; 19 import tango.core.Exception;
20 import tango.io.Stdout;
21 20
22 /** 21 /**
23 * This error is thrown whenever an unrecoverable error 22 * This error is thrown whenever an unrecoverable error
24 * occurs internally in DWT. The message text and error code 23 * occurs internally in DWT. The message text and error code
25 * provide a further description of the problem. The exception 24 * provide a further description of the problem. The exception
148 * Note: printStackTrace(PrintStream) and printStackTrace(PrintWriter) 147 * Note: printStackTrace(PrintStream) and printStackTrace(PrintWriter)
149 * are not provided in order to maintain compatibility with CLDC. 148 * are not provided in order to maintain compatibility with CLDC.
150 * </p> 149 * </p>
151 */ 150 */
152 public void printStackTrace () { 151 public void printStackTrace () {
153 Stderr.formatln( "stacktrace follows (if feature compiled in)" ); 152 getDwtLogger().error( "stacktrace follows (if feature compiled in)" );
154 foreach( msg; info ){ 153 foreach( msg; info ){
155 Stderr.formatln( "{}", msg ); 154 getDwtLogger().error( "{}", msg );
156 } 155 }
157 if ( throwable !is null) { 156 if ( throwable !is null) {
158 Stderr.formatln ("*** Stack trace of contained error ***"); //$NON-NLS-1$ 157 getDwtLogger().error ("*** Stack trace of contained error ***"); //$NON-NLS-1$
159 foreach( msg; throwable.info ){ 158 foreach( msg; throwable.info ){
160 Stderr.formatln( "{}", msg ); 159 getDwtLogger().error( "{}", msg );
161 } 160 }
162 } 161 }
163 } 162 }
164 163
165 } 164 }