Skip to content

Commit

Permalink
download error handling - prevent AttributeError
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksMat committed Mar 5, 2018
1 parent 16fc933 commit c67d0cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sentinelhub/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ def _is_temporal_problem(exception):
:return: True if exception is temporal and False otherwise
:rtype: bool
"""
return isinstance(exception, (requests.ConnectionError, requests.ConnectTimeout, requests.ReadTimeout,
requests.Timeout))
try:
return isinstance(exception, (requests.ConnectionError, requests.Timeout))
except AttributeError: # Earlier requests versions might not have requests.Timeout
return isinstance(exception, requests.ConnectionError)


def _create_download_failed_message(exception):
Expand Down

0 comments on commit c67d0cc

Please sign in to comment.