Skip to content

Commit fc75979

Browse files
sjkellyKristofferC
authored andcommitted
completely initialize SystemError (#44192)
(cherry picked from commit 2db86f2)
1 parent 6b43499 commit fc75979

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

base/io.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct SystemError <: Exception
2020
extrainfo
2121
SystemError(p::AbstractString, e::Integer, extrainfo) = new(p, e, extrainfo)
2222
SystemError(p::AbstractString, e::Integer) = new(p, e, nothing)
23-
SystemError(p::AbstractString) = new(p, Libc.errno())
23+
SystemError(p::AbstractString) = new(p, Libc.errno(), nothing)
2424
end
2525

2626
lock(::IO) = nothing

test/error.jl

+5
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ end
8181
# non-Functions
8282
@test retry(Float64)(1) === 1.0
8383
end
84+
85+
@testset "SystemError initialization" begin
86+
e = SystemError("fail")
87+
@test e.extrainfo === nothing
88+
end

0 commit comments

Comments
 (0)