make mxerr more robust
This commit is contained in:
parent
21775f8c89
commit
f230b7cebf
@ -105,6 +105,7 @@ macro mxerr(stk, ex)
|
|||||||
catch e
|
catch e
|
||||||
(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()
|
||||||
throw(Exception(e, totrace(stk[node])))
|
throw(Exception(e, totrace(stk[node])))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
@ -25,6 +25,7 @@ end
|
|||||||
e = try mxnet(model, (10, 1))
|
e = try mxnet(model, (10, 1))
|
||||||
catch e e end
|
catch e e end
|
||||||
|
|
||||||
|
@test isa(e, DataFlow.Interpreter.Exception)
|
||||||
@test e.trace[1].func == Symbol("Flux.Affine")
|
@test e.trace[1].func == Symbol("Flux.Affine")
|
||||||
@test e.trace[2].func == :TLP
|
@test e.trace[2].func == :TLP
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user