diff --git a/aioxmlrpc/client.py b/aioxmlrpc/client.py
index 35bca86..5ed292b 100644
--- a/aioxmlrpc/client.py
+++ b/aioxmlrpc/client.py
@@ -79,8 +79,14 @@ class AioTransport(xmlrpc.Transport):
             raise
         except Exception as exc:
             log.error('Unexpected error', exc_info=True)
-            raise ProtocolError(url, response.status,
-                                str(exc), response.headers)
+            if response is not None:
+                errcode = response.status
+                headers = response.headers
+            else:
+                errcode = 0
+                headers = {}
+
+            raise ProtocolError(url, errcode, str(exc), headers)
         return self.parse_response(body)
 
     def parse_response(self, body):

AttributeError when server closes socket
If the XMLRPC server closes the socket, which is rather common if it's Apache, I get this error:

```
Traceback (most recent call last):
  File "/usr/share/routest/env/lib/python3.5/site-packages/aioxmlrpc/client.py", line 71, in request
    connector=self._connector, loop=self._loop)
  File "/usr/share/routest/env/lib/python3.5/site-packages/aiohttp/client.py", line 605, in __iter__
    return (yield from self._coro)
  File "/usr/share/routest/env/lib/python3.5/site-packages/aiohttp/client.py", line 161, in _request
    raise RuntimeError('Session is closed')
RuntimeError: Session is closed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/share/routest/env/lib/python3.5/site-packages/routest/resource/space/serializers.py", line 159, in check_job_status
    self.job_status = await self.lava.scheduler.job_status(self.job_id)
  File "/usr/share/routest/env/lib/python3.5/site-packages/aioxmlrpc/client.py", line 37, in __call__
    ret = yield from self.__send(self.__name, args)
  File "/usr/share/routest/env/lib/python3.5/site-packages/aioxmlrpc/client.py", line 130, in __request
    verbose=self.__verbose
  File "/usr/share/routest/env/lib/python3.5/site-packages/aioxmlrpc/client.py", line 80, in request
    raise ProtocolError(url, response.status,
AttributeError: 'NoneType' object has no attribute 'status'
```
diff --git a/aioxmlrpc/tests/test_client.py b/aioxmlrpc/tests/test_client.py
index 304045d..98fef6b 100644
--- a/aioxmlrpc/tests/test_client.py
+++ b/aioxmlrpc/tests/test_client.py
@@ -128,3 +128,28 @@ class ServerProxyTestCase(TestCase):
       self.assertEqual(response, 1)
       self.assertIs(self.loop, client._loop)
       self.assertTrue(transp._connector.close.called)
+
+
+@asyncio.coroutine
+def failing_request(*args, **kwargs):
+    raise OSError
+
+
+class HTTPErrorTestCase(TestCase):
+
+    def setUp(self):
+        self.loop = asyncio.new_event_loop()
+        asyncio.set_event_loop(None)
+        self.aiohttp_request = mock.patch('aiohttp.request', new=failing_request)
+        self.aiohttp_request.start()
+
+    def tearDown(self):
+        self.aiohttp_request.stop()
+
+    def test_http_error(self):
+        from aioxmlrpc.client import ServerProxy, ProtocolError
+        client = ServerProxy('http://nonexistent/nonexistent', loop=self.loop)
+        self.assertRaises(ProtocolError,
+                          self.loop.run_until_complete,
+                          client.name.space.proxfyiedcall()
+                          )

pip install -e .
parse_log_pytest
pytest
pytest
3.5
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aiohttp==3.8.6
aiosignal==1.2.0
-e git+https://github.com/mardiros/aioxmlrpc.git@5480f35630d166bfa686e2e02b28c581e16bb723#egg=aioxmlrpc
async-timeout==4.0.2
asynctest==0.13.0
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
charset-normalizer==3.0.1
frozenlist==1.2.0
idna==3.10
idna-ssl==1.1.0
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
multidict==5.2.0
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
yarl==1.7.2
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: aioxmlrpc
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aiohttp==3.8.6
      - aiosignal==1.2.0
      - async-timeout==4.0.2
      - asynctest==0.13.0
      - charset-normalizer==3.0.1
      - frozenlist==1.2.0
      - idna==3.10
      - idna-ssl==1.1.0
      - multidict==5.2.0
      - yarl==1.7.2
prefix: /opt/conda/envs/aioxmlrpc

aioxmlrpc/tests/test_client.py::HTTPErrorTestCase::test_http_error
aioxmlrpc/tests/test_client.py::ServerProxyTestCase::test_close_transport aioxmlrpc/tests/test_client.py::ServerProxyTestCase::test_http_500 aioxmlrpc/tests/test_client.py::ServerProxyTestCase::test_xmlrpc_fault aioxmlrpc/tests/test_client.py::ServerProxyTestCase::test_xmlrpc_ok aioxmlrpc/tests/test_client.py::ServerProxyTestCase::test_xmlrpc_ok_global_loop
aioxmlrpc/client.py
aioxmlrpc/client.py