summaryrefslogtreecommitdiffstats
path: root/cli/cli.py
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2023-10-17 09:27:46 +0200
committerJose M. Guisado <jguisado@soleta.eu>2023-10-18 10:41:26 +0200
commit7c30d569100a351f2a0a6430093abb8791f44fcf (patch)
treebefc0ae42f384439935cd4896b6f32375ca33d05 /cli/cli.py
parent181075e5053f03080f2a82784bf0368d53365e9d (diff)
cli: fix messages when receiving an error response
ogCLI displays a message like "Cannot connect to ogServer: [...]" when ogServer replies with something different from 2XX. Fix these strings because ogServer is actually connected and replying to an ogCLI request.
Diffstat (limited to 'cli/cli.py')
-rw-r--r--cli/cli.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/cli.py b/cli/cli.py
index db52b4c..f2175a7 100644
--- a/cli/cli.py
+++ b/cli/cli.py
@@ -32,8 +32,8 @@ class OgREST():
headers=self.HEADERS,
json=payload)
if r.status_code != 200:
- sys.exit(f"Cannot connect to ogServer: "
- f"{r.status_code} HTTP status code")
+ sys.exit(f"Unsuccessful request to ogServer: "
+ f"Response with {r.status_code} HTTP status code")
except IOError as e:
sys.exit(f"Cannot connect to ogServer: {e}")
return r
@@ -45,8 +45,8 @@ class OgREST():
json=payload)
print(r.text)
if r.status_code not in {200, 202}:
- sys.exit(f"Cannot connect to ogServer: "
- f"{r.status_code} HTTP status code")
+ sys.exit(f"Unsuccessful request to ogServer: "
+ f"Response with {r.status_code} HTTP status code")
except IOError as e:
sys.exit(f"Cannot connect to ogServer: {e}")
return r
@@ -59,7 +59,7 @@ class OgREST():
print(r.text)
if r.status_code != 200:
sys.exit(f"Unsuccessful request to ogServer: "
- f"{r.status_code} HTTP status code")
+ f"Response with {r.status_code} HTTP status code")
except IOError as e:
sys.exit(f"Cannot connect to ogServer: {e}")
return r