Compare commits

...

2 Commits

Author SHA1 Message Date
HoneyryderChuck
e8be009c7c Merge branch 'uixsock-bug' into 'master'
bugfix: exit with error when unix socket path does not exist

See merge request os85/httpx!230
2022-12-29 13:46:22 +00:00
HoneyryderChuck
c7a38ee5b4 bugfix: exit with error when unix socket path does not exist 2022-12-29 12:54:47 +00:00
2 changed files with 7 additions and 1 deletions

View File

@ -526,7 +526,8 @@ module HTTPX
Errno::EHOSTUNREACH,
Errno::EINVAL,
Errno::ENETUNREACH,
Errno::EPIPE => e
Errno::EPIPE,
Errno::ENOENT => e
# connect errors, exit gracefully
error = ConnectionError.new(e.message)
error.set_backtrace(e.backtrace)

View File

@ -20,6 +20,11 @@ class UnixTest < Minitest::Test
end
end
def test_unix_session_no_path
response = HTTPX.get("http://does-not-matter", transport: "unix", addresses: "blabla.sock")
verify_error_response(response, /No such file or directory/)
end
def test_unix_session_io
on_unix_server(__method__) do |path|
io = UNIXSocket.new(path)