mirror of
https://github.com/clearml/clearml
synced 2025-03-03 10:42:00 +00:00
Improve error message when checking permissions
This commit is contained in:
parent
68cf2745ff
commit
21712a709d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user