changeset 249:e1ec1581e355

Fix ExceptionPrintStacktrace
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 19:45:02 +0200
parents 34409a2fc053
children 66441b183ff5
files dwt/dwthelper/utils.d
diffstat 1 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d	Thu May 22 19:00:47 2008 +0200
+++ b/dwt/dwthelper/utils.d	Thu May 22 19:45:02 2008 +0200
@@ -21,16 +21,6 @@
 import tango.util.log.Trace;
 import tango.text.UnicodeData;
 static import tango.util.collection.model.Seq;
-// static import tango.util.collection.ArraySeq;
-// static import tango.util.collection.LinkSeq;
-// static import tango.util.collection.model.Map;
-// static import tango.util.collection.HashMap;
-//
-// alias tango.util.collection.model.Seq.Seq!(Object) List;
-// alias tango.util.collection.ArraySeq.ArraySeq!(Object) ArrayList;
-// alias tango.util.collection.LinkSeq.LinkSeq!(Object) LinkList;
-// alias tango.util.collection.model.Map.Map!(Object,Object) Map;
-// alias tango.util.collection.HashMap.HashMap!(Object,Object) HashMap;
 
 alias char[] String;
 alias tango.text.Text.Text!(char) StringBuffer;
@@ -777,6 +767,9 @@
     return s.poolsize;
 }
 
+String ExceptionGetLocalizedMessage( Exception e ){
+    return e.msg;
+}
 
 void ExceptionPrintStackTrace( Exception e ){
     ExceptionPrintStackTrace( e, Stderr );
@@ -785,8 +778,10 @@
     Exception exception = e;
     while( exception !is null ){
         print.formatln( "Exception in {}({}): {}", exception.file, exception.line, exception.msg );
-        foreach( msg; exception.info ){
-            print.formatln( "trc {}", msg );
+        if( exception.info !is null ){
+            foreach( msg; exception.info ){
+                print.formatln( "trc {}", msg );
+            }
         }
         exception = exception.next;
     }