Skip to content

Commit

Permalink
Merge pull request #326 from cool-RR/patch-1
Browse files Browse the repository at this point in the history
Fix 2 exception causes in core.py
  • Loading branch information
martindurant committed Jun 12, 2020
2 parents a41167c + 6bad6f5 commit f9ec635
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ def _upload_chunk(self, final=False):
exc_info=True)
time.sleep(1.7**attempt * 0.1)
except Exception as exc:
raise IOError('Write failed: %r' % exc)
raise IOError('Write failed: %r' % exc) from exc
else:
raise IOError('Write failed after %i retries' % self.retries)

Expand Down Expand Up @@ -1400,7 +1400,7 @@ def _fetch_range(client, bucket, key, version_id, start, end, max_attempts=10,
if e.response['Error'].get('Code', 'Unknown') in ['416',
'InvalidRange']:
return b''
raise translate_boto_error(e)
raise translate_boto_error(e) from e
except Exception as e:
if 'time' in str(e).lower(): # Actual exception type changes often
continue
Expand Down

0 comments on commit f9ec635

Please sign in to comment.