remove c++ stacktrace
This commit is contained in:
parent
a819480650
commit
4c0e915c00
@ -99,6 +99,8 @@ function errnode(e::mx.MXError)
|
|||||||
Symbol(m.captures[1])
|
Symbol(m.captures[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
striptrace(e::mx.MXError) = mx.MXError(split(e.msg, "\n")[1])
|
||||||
|
|
||||||
macro mxerr(stk, ex)
|
macro mxerr(stk, ex)
|
||||||
:(try
|
:(try
|
||||||
$(esc(ex))
|
$(esc(ex))
|
||||||
@ -106,6 +108,6 @@ macro mxerr(stk, ex)
|
|||||||
(isa(e, mx.MXError) && (node = errnode(e)) != nothing) || rethrow()
|
(isa(e, mx.MXError) && (node = errnode(e)) != nothing) || rethrow()
|
||||||
stk = $(esc(stk))
|
stk = $(esc(stk))
|
||||||
haskey(stk, node) || rethrow()
|
haskey(stk, node) || rethrow()
|
||||||
throw(Exception(e, totrace(stk[node])))
|
throw(Exception(striptrace(e), totrace(stk[node])))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user