better stack trace handling
This commit is contained in:
parent
3afd852f54
commit
113857c7f1
1 changed files with 7 additions and 2 deletions
|
|
@ -282,8 +282,13 @@ proc raiseExceptionAux(e: ref Exception) =
|
|||
proc raiseException(e: ref Exception, ename: cstring) {.compilerRtl.} =
|
||||
if e.name.isNil: e.name = ename
|
||||
when hasSomeStackTrace:
|
||||
e.trace = ""
|
||||
rawWriteStackTrace(e.trace)
|
||||
if e.trace.isNil:
|
||||
e.trace = ""
|
||||
rawWriteStackTrace(e.trace)
|
||||
elif framePtr != nil:
|
||||
e.trace.add "[[reraised from:\n"
|
||||
auxWriteStackTrace(framePtr, e.trace)
|
||||
e.trace.add "]]\n"
|
||||
raiseExceptionAux(e)
|
||||
|
||||
proc reraiseException() {.compilerRtl.} =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue