remove c++ stacktrace

This commit is contained in:
Mike J Innes 2017-02-27 19:49:32 +00:00
parent a819480650
commit 4c0e915c00

View File

@ -99,6 +99,8 @@ function errnode(e::mx.MXError)
Symbol(m.captures[1])
end
striptrace(e::mx.MXError) = mx.MXError(split(e.msg, "\n")[1])
macro mxerr(stk, ex)
:(try
$(esc(ex))
@ -106,6 +108,6 @@ macro mxerr(stk, ex)
(isa(e, mx.MXError) && (node = errnode(e)) != nothing) || rethrow()
stk = $(esc(stk))
haskey(stk, node) || rethrow()
throw(Exception(e, totrace(stk[node])))
throw(Exception(striptrace(e), totrace(stk[node])))
end)
end