smore-inc / tinys3

A simple python S3 upload library. Inspired by requests
MIT License
285 stars 54 forks source link

bad request errors not passed through #43

Open amn41 opened 9 years ago

amn41 commented 9 years ago

steps to reproduce:

run first example in the documentation with a non-existent bucket name, mismatching region name, or other incorrect specification. conn.upload() throws a stack trace :

   File "upload_to_s3.py", line 12, in <module>
    print(conn.upload(filename,f,bucketname))
  File "/path/connection.py", line 152, in upload
    return self.run(r)
  File "/path//connection.py", line 233, in run
    return self._handle_request(request)
  File "/path/connection.py", line 255, in _handle_request
    return request.run()
  File "/path/request_factory.py", line 180, in run
    r.raise_for_status()
  File "/path/models.py", line 851, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request

Either amazon is not throwing a more specific error message, or it is but it's not being passed along.

VemityAI commented 7 years ago

Same