mirror of https://github.com/status-im/NimYAML.git
echo internal stack trace if not release, check if parent is nil
This commit is contained in:
parent
a211eab2c6
commit
ba06599b7d
|
@ -15,9 +15,9 @@ template internalError*(s: string) =
|
||||||
echo "[NimYAML] Stacktrace:"
|
echo "[NimYAML] Stacktrace:"
|
||||||
try:
|
try:
|
||||||
writeStackTrace()
|
writeStackTrace()
|
||||||
when defined(debug):
|
echo "Internal stacktrace:"
|
||||||
echo "Internal stacktrace:"
|
let exc = getCurrentException()
|
||||||
let exc = getCurrentException()
|
if not isNil(exc.parent):
|
||||||
echo getStackTrace(exc.parent)
|
echo getStackTrace(exc.parent)
|
||||||
except: discard
|
except: discard
|
||||||
echo "[NimYAML] Please report this bug."
|
echo "[NimYAML] Please report this bug."
|
||||||
|
@ -33,9 +33,9 @@ template yAssert*(e: typed) =
|
||||||
echo "[NimYAML] Stacktrace:"
|
echo "[NimYAML] Stacktrace:"
|
||||||
try:
|
try:
|
||||||
writeStackTrace()
|
writeStackTrace()
|
||||||
when defined(debug):
|
echo "Internal stacktrace:"
|
||||||
echo "Internal stacktrace:"
|
let exc = getCurrentException()
|
||||||
let exc = getCurrentException()
|
if not isNil(exc.parent):
|
||||||
echo getStackTrace(exc.parent)
|
echo getStackTrace(exc.parent)
|
||||||
except: discard
|
except: discard
|
||||||
echo "[NimYAML] Please report this bug."
|
echo "[NimYAML] Please report this bug."
|
||||||
|
|
Loading…
Reference in New Issue