Skip to content

Commit 66b5385

Browse files
committed
print errors to STDERR
1 parent 0dfa611 commit 66b5385

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/error_handling.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Handles a list of thrown errors after no IO library was found working
6060
function handle_exceptions(exceptions::Vector, action)
6161
# first show all errors when there are more then one
6262
multiple = length(exceptions) > 1
63-
println("Error$(multiple?"s" : "") encountered while $action.")
63+
println(STDERR, "Error$(multiple?"s" : "") encountered while $action.")
6464
if multiple
6565
println("All errors:")
6666
for (err, file) in exceptions
@@ -70,7 +70,7 @@ function handle_exceptions(exceptions::Vector, action)
7070
# then handle all errors.
7171
# this way first fatal exception throws and user can still see all errors
7272
# TODO, don't throw, if it contains a NotInstalledError?!
73-
println("Fatal error:")
73+
println(STDERR, "Fatal error:")
7474
for exception in exceptions
7575
continue_ = handle_error(exception...)
7676
continue_ || break

test/error_handling.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ add_format(format"BROKEN", (), ".brok", [:BrokenIO])
4141
@test_throws FileIO.LoaderError load(Stream(format"BROKEN",STDIN))
4242
@test_throws FileIO.WriterError save(Stream(format"BROKEN",STDOUT))
4343
redirect_stderr(stderr_copy)
44+
close(rserr);close(wrerr)
4445
end
4546

4647
module MultiError1
@@ -62,4 +63,4 @@ end
6263
)
6364
ret = @test_throws ErrorException load("test.multierr")
6465
#@test ret.value.msg == "1" # this is 0.5 only
65-
end
66+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ else
55
using BaseTestNext
66
const Test = BaseTestNext
77
end
8+
89
@testset "FileIO" begin
910
include("query.jl")
1011
include("loadsave.jl")

0 commit comments

Comments
 (0)