diff --git a/lib/httpx/connection.rb b/lib/httpx/connection.rb index 9c15e11d..39314db7 100644 --- a/lib/httpx/connection.rb +++ b/lib/httpx/connection.rb @@ -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) diff --git a/test/io/unix_test.rb b/test/io/unix_test.rb index 3f53bf29..00e9998a 100644 --- a/test/io/unix_test.rb +++ b/test/io/unix_test.rb @@ -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)