Skip to content

Commit

Permalink
unwrap nested ParserException to fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alyst committed Jul 10, 2021
1 parent 2db1bc1 commit 9ac7df8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/core/parsers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,17 @@ function make_all(config; kargs_make...)
end

function once(channel)
for result in channel
return result
try
for result in channel
return result
end
catch ex
# unwrap exception
if VERSION >= v"1.1"
ex isa TaskFailedException ? throw(first(first(Base.catch_stack(ex.task)))) : rethrow()
else
rethrow()
end
end
throw(ParserException("cannot parse"))
end
Expand Down

0 comments on commit 9ac7df8

Please sign in to comment.