Skip to content

Commit

Permalink
Fix display of Sockets.DNSError
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Mar 15, 2018
1 parent 29a1719 commit 857dd51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/Sockets/src/addrinfo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ struct DNSError <: Exception
end

function show(io::IO, err::DNSError)
print(io, "DNSError: ", err.host, ", ", struverror(err.code),
" (", uverrorname(err.code), ")")
print(io, "DNSError: ", err.host, ", ", Base.struverror(err.code),
" (", Base.uverrorname(err.code), ")")
end

function uv_getaddrinfocb(req::Ptr{Cvoid}, status::Cint, addrinfo::Ptr{Cvoid})
Expand Down
2 changes: 2 additions & 0 deletions stdlib/Sockets/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ end
@test_throws Sockets.DNSError getaddrinfo(".invalid")
@test_throws ArgumentError getaddrinfo("localhost\0") # issue #10994
@test_throws Base.UVError("connect", Base.UV_ECONNREFUSED) connect(ip"127.0.0.1", 21452)
e = (try; getaddrinfo(".invalid"); catch ex; ex; end)
@test startswith(sprint(show, e), "DNSError:")
end

@testset "invalid port" begin
Expand Down

0 comments on commit 857dd51

Please sign in to comment.