Why is the exception not rethrown in logging?

https://github.com/JuliaLang/julia/blob/ae1aa16bc0ee608568d799e25620ba9580110f9b/base/logging.jl#L339-L346

Can anyone explain why the exception is not rethrown here?

We find that this will create something inconsistent in tests. See discussions here: https://github.com/JuliaReinforcementLearning/ReinforcementLearning.jl/pull/263#issuecomment-833566441

For example:

@testset "test" begin
    a = error("abc")
    @info "testing..." a
end

This will result in a report with an error:

Test Summary: | Error  Total
test          |     1      1
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /mnt/E4E0A9C0E0A998F6/github/test_flux/abc/test/runtests.jl:3
ERROR: Package abc errored during testing

While the following one will not (just the same with the one in our tests):

using Test

@testset "test" begin
    @info "testing..." a = error("abc")
end
     Testing Running tests...
Test Summary: |
test          | No tests
     Testing abc tests passed