Skip to content

Commit

Permalink
first pass at conn error fix in upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jake authored and jake committed Jan 25, 2024
1 parent 6e23216 commit 59c6d56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internetarchive/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.6.0'
__version__ = '3.7.0.dev1'
6 changes: 3 additions & 3 deletions internetarchive/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from xml.parsers.expat import ExpatError

from requests import Request, Response
from requests.exceptions import HTTPError
from requests.exceptions import RequestException
from tqdm import tqdm

from internetarchive import catalog
Expand Down Expand Up @@ -1104,7 +1104,7 @@ def _build_request():
os.remove(filename)
response.close()
return response
except HTTPError as exc:
except RequestException as exc:
try:
msg = get_s3_xml_text(exc.response.content) # type: ignore
except ExpatError: # probably HTTP 500 error and response is invalid XML
Expand All @@ -1117,7 +1117,7 @@ def _build_request():
log.error(error_msg)
if verbose:
print(f' error uploading {key}: {msg}', file=sys.stderr)
# Raise HTTPError with error message.
# Raise RequestException with error message.
raise type(exc)(error_msg, response=exc.response, request=exc.request)
finally:
body.close()
Expand Down

0 comments on commit 59c6d56

Please sign in to comment.