diff --git a/wfdb/io/download.py b/wfdb/io/download.py
index <HASH>..<HASH> 100644
--- a/wfdb/io/download.py
+++ b/wfdb/io/download.py
@@ -300,12 +300,13 @@ def get_record_list(db_dir, records='all'):
 
     # Check for a RECORDS file
     if records == 'all':
-        response = requests.get(posixpath.join(db_url, 'RECORDS'))
-        if response.status_code == 404:
+        try:
+            content = _get_url(posixpath.join(db_url, 'RECORDS'))
+        except FileNotFoundError:
             raise ValueError('The database %s has no WFDB files to download' % db_url)
 
         # Get each line as a string
-        record_list = response.content.decode('ascii').splitlines()
+        record_list = content.decode('ascii').splitlines()
     # Otherwise the records are input manually
     else:
         record_list = records
get_record_list: use _get_url in place of requests.get.

Note that this will handle errors (e.g. a file that we are not
authorized to access) and raise an exception, rather than trying to
parse the error document.  Previously, <I> errors were handled, but
other types of errors were not.