1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|storage] Automatically abort multipart uploads on exceptions

This commit is contained in:
Aaron Suggs 2012-03-04 19:38:19 -05:00
parent 16b6ac9b05
commit 85fe220470

View file

@ -176,6 +176,11 @@ module Fog
part_tags << part_upload.headers["ETag"]
end
rescue
# Abort the upload & reraise
connection.abort_multipart_upload(directory.key, key, upload_id) if upload_id
raise
else
# Complete the upload
connection.complete_multipart_upload(directory.key, key, upload_id, part_tags)
end