Skip to content

Commit

Permalink
move.py: check copy_result_tb return
Browse files Browse the repository at this point in the history
copy_result_tb returns the response from the PUT, and
does not raise an exception for HTTP errrors; so we
now check the return value and raise an exception
on error.
  • Loading branch information
ndokos committed Mar 16, 2023
1 parent b023aa9 commit 310d069
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pbench/cli/agent/commands/results/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ def execute(self, single_threaded: bool, delete: bool = True) -> int:
self.config,
self.logger,
)
crt.copy_result_tb(
res = crt.copy_result_tb(
self.context.token, self.context.access, self.context.metadata
)
if not res.ok:
raise CopyResultTb.FileUploadError
except Exception as exc:
if isinstance(exc, (CopyResultTb.FileUploadError, RuntimeError)):
msg = "Error uploading file"
Expand Down

0 comments on commit 310d069

Please sign in to comment.