Skip to content

Commit

Permalink
improve line info display for error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Pangoraw committed Jan 21, 2024
1 parent 9e6e63b commit e00a28c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/compiler/reverse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,8 @@ function adjoint(pr::Primal)
if has_leave && isempty(predecessors(b)) && b.id != 1
_, f_stmt = first(b)
li = pr.ir.lines[f_stmt.line]
li = LineNumberNode(Int(li.line), li.file)
pushfirst!(rb, stmt(xcall(Base, :error,
"Can't differentiate function execution in catch block at $(li).")))
"Can't differentiate function execution in catch block at $(li.file):$(li.line).")))
end

if b.id > 1 # Backprop through (predecessor) branch arguments
Expand Down

0 comments on commit e00a28c

Please sign in to comment.