1. David Larlet
  2. django-storages
  3. Issues

Issues

Issue #162 new

Reraise boto/httplib errors as IOErrors

melinath
created an issue

The s3boto backend currently lets exceptions from the connection to s3 propagate. It seems like the correct behavior would be to catch these and reraise them as IOErrors, to more closely emulate the behavior of (say) the filesystem backend.

Affected exceptions would include:

  • httplib.IncompleteRead
  • boto.exception.BotoServerError
  • boto.exception.S3ResponseError
  • ssl.SSLError

There are probably other exceptions which it might also make sense to catch and reraise as IOError; these are just the ones I've run into.

Comments (3)

  1. Ian Lewis

    The FileSystemStorage throws IOErrors just because that's what get's thrown by the standard library routines. The storage api doesn't really specify that you should throw a particular kind of error so I'm would be wary of catching and wrapping errors because the original error becomes much more obtuse.

  2. Log in to comment