diff --git a/lib/pbench/cli/agent/commands/results/move.py b/lib/pbench/cli/agent/commands/results/move.py index b9b8ef8355..b64d981a8b 100644 --- a/lib/pbench/cli/agent/commands/results/move.py +++ b/lib/pbench/cli/agent/commands/results/move.py @@ -5,7 +5,6 @@ from typing import List import click -import requests from pbench.agent.base import BaseCommand from pbench.agent.results import CopyResultTb, MakeResultTb @@ -111,7 +110,7 @@ def execute(self, single_threaded: bool, delete: bool = True) -> int: if not res.ok: try: msg = res.json()["message"] - except requests.exceptions.JSONDecodeError: + except Exception: msg = res.text if res.text else res.reason raise CopyResultTb.FileUploadError(msg) except Exception as exc: diff --git a/lib/pbench/cli/agent/commands/results/push.py b/lib/pbench/cli/agent/commands/results/push.py index 186405ad07..db5b39bafe 100644 --- a/lib/pbench/cli/agent/commands/results/push.py +++ b/lib/pbench/cli/agent/commands/results/push.py @@ -3,7 +3,6 @@ from typing import List import click -import requests from pbench.agent.base import BaseCommand from pbench.agent.results import CopyResultTb @@ -36,7 +35,7 @@ def execute(self) -> int: try: msg = res.json()["message"] - except requests.exceptions.JSONDecodeError: + except Exception: msg = res.text if res.text else res.reason # dup or other unexpected but non-error status