From 21712a709d052a2bd62f1324b7c1fa928dbd6ece Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 28 Jun 2022 21:08:40 +0300 Subject: [PATCH] Improve error message when checking permissions --- clearml/storage/helper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clearml/storage/helper.py b/clearml/storage/helper.py index 867c4104..2bed7d63 100644 --- a/clearml/storage/helper.py +++ b/clearml/storage/helper.py @@ -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