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 a59fc0b
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(Base.catch_stack(ex.task, include_bt=false))) : rethrow()
else
rethrow()
end
end
throw(ParserException("cannot parse"))
end
Expand Down

0 comments on commit a59fc0b

Please sign in to comment.