summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-laptop>2010-08-14 15:46:07 +0200
committerAndreas Rumpf <andreas@andreas-laptop>2010-08-14 15:46:07 +0200
commitfc0b66a7ff1c17fae66e604279524e757451bd1d (patch)
tree6d3c17703fe5b5beb6db6df58b9de674ec60fc02 /lib/system
parentfee8e328efa97680efbcfdb72fa4a7b34ee5b564 (diff)
downloadNim-fc0b66a7ff1c17fae66e604279524e757451bd1d.tar.gz
accurate file/line information
Diffstat (limited to 'lib/system')
-rwxr-xr-xlib/system/excpt.nim11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim
index 673e5a50e..d8bdf2a9f 100755
--- a/lib/system/excpt.nim
+++ b/lib/system/excpt.nim
@@ -68,7 +68,8 @@ var
 
   tempFrames: array [0..127, PFrame] # cannot be allocated on the stack!
   
-  stackTraceNewLine* = "\n" ## undocumented feature
+  stackTraceNewLine* = "\n" ## undocumented feature; it is replaced by ``<br>``
+                            ## for CGI applications
 
 proc auxWriteStackTrace(f: PFrame, s: var string) =
   const 
@@ -102,10 +103,14 @@ proc auxWriteStackTrace(f: PFrame, s: var string) =
       add(s, $(total-i-1))
       add(s, " calls omitted) ...")
     else:
-      add(s, $tempFrames[j].procname)
+      var oldLen = s.len
+      add(s, tempFrames[j].filename)
       if tempFrames[j].line > 0:
-        add(s, ", line: ")
+        add(s, '(')
         add(s, $tempFrames[j].line)
+        add(s, ')')
+      for k in 1..max(1, 25-(s.len-oldLen)): add(s, ' ')
+      add(s, tempFrames[j].procname)
     add(s, stackTraceNewLine)
 
 proc rawWriteStackTrace(s: var string) =