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.} =
|
proc raiseException(e: ref Exception, ename: cstring) {.compilerRtl.} =
|
||||||
if e.name.isNil: e.name = ename
|
if e.name.isNil: e.name = ename
|
||||||
when hasSomeStackTrace:
|
when hasSomeStackTrace:
|
||||||
e.trace = ""
|
if e.trace.isNil:
|
||||||
rawWriteStackTrace(e.trace)
|
e.trace = ""
|
||||||
|
rawWriteStackTrace(e.trace)
|
||||||
|
elif framePtr != nil:
|
||||||
|
e.trace.add "[[reraised from:\n"
|
||||||
|
auxWriteStackTrace(framePtr, e.trace)
|
||||||
|
e.trace.add "]]\n"
|
||||||
raiseExceptionAux(e)
|
raiseExceptionAux(e)
|
||||||
|
|
||||||
proc reraiseException() {.compilerRtl.} =
|
proc reraiseException() {.compilerRtl.} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue