File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ function Base.copy(t::Task)
8484end
8585
8686struct CTaskException
87+ etype
8788 msg:: String
8889 backtrace:: Vector{Union{Ptr{Nothing}, Base.InterpreterIP}}
8990end
@@ -191,7 +192,12 @@ consume(p::Task, values...) = begin
191192 return p. result
192193 end
193194 if p. exception != nothing
194- throw (CTaskException (p. exception. msg, p. backtrace))
195+ msg = if :msg in fieldnames (typeof (p. exception))
196+ p. exception. msg
197+ else
198+ string (typeof (p. exception))
199+ end
200+ throw (CTaskException (typeof (p. exception), msg, p. backtrace))
195201 end
196202 end
197203 wait ()
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ r = @testset "Broken Functions Tests" begin
1717 try
1818 consume (t)
1919 catch ex
20- @test isa (ex, ErrorException)
20+ @test ex . etype == ErrorException
2121 end
2222 @test isa (t. exception, ErrorException)
2323 end
@@ -37,7 +37,7 @@ r = @testset "Broken Functions Tests" begin
3737 try
3838 consume (t)
3939 catch ex
40- @test isa (ex, BoundsError)
40+ @test ex . etype == BoundsError
4141 end
4242 @test isa (t. exception, BoundsError)
4343 end
@@ -58,7 +58,7 @@ r = @testset "Broken Functions Tests" begin
5858 try
5959 consume (t)
6060 catch ex
61- @test isa (ex, BoundsError)
61+ @test ex . etype == BoundsError
6262 end
6363 @test isa (t. exception, BoundsError)
6464 end
@@ -80,7 +80,7 @@ r = @testset "Broken Functions Tests" begin
8080 try
8181 consume (t_copy)
8282 catch ex
83- @test isa (ex, BoundsError)
83+ @test ex . etype == BoundsError
8484 end
8585 @test isa (t_copy. exception, BoundsError)
8686 end
You can’t perform that action at this time.
0 commit comments