Improve error message when checking permissions

This commit is contained in:
allegroai 2022-06-28 21:08:40 +03:00
parent 68cf2745ff
commit 21712a709d

View File

@ -843,11 +843,16 @@ class StorageHelper(object):
# do not check http/s connection permissions
if dest_path.startswith('http'):
return True
err_msg = 'Insufficient permissions ({} failed) for ' + base_url
try:
self.upload_from_stream(stream=six.BytesIO(b'clearml'), dest_path=dest_path)
except Exception:
raise ValueError(err_msg.format("write"))
try:
self.delete(path=dest_path)
except Exception:
raise ValueError('Insufficient permissions for {}'.format(base_url))
raise ValueError(err_msg.format("delete"))
return True
@classmethod