[10.0] Fix connection errors when we read attachment

This commit is contained in:
jcoux authored and GitHub committed 2017-12-22 07:47:54 +01:00
1 parent 49ddc76ec3
commit bf2f5dcb20
1 file changed
+7 -1
+7 -1
View File
@@ -57,7 +57,13 @@ class IrAttachment(models.Model):
def _store_file_read(self, fname, bin_size=False):
if fname.startswith('swift://'):
swifturi = SwiftUri(fname)
conn = self._get_swift_connection()
try:
conn = self._get_swift_connection()
except exceptions.UserError:
_logger.exception(
"error reading attachment '%s' from object storage", fname
)
return ''
try:
resp, obj_content = conn.get_object(swifturi.container(),
swifturi.item())
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.