From e527ba611dc153de02234178e31654f2b025e10b Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 26 Sep 2024 19:41:38 -0300 Subject: [PATCH] pxe: improve error msgs in wb-script --- workbench-script.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workbench-script.py b/workbench-script.py index 80b1c1d..f4b01a6 100644 --- a/workbench-script.py +++ b/workbench-script.py @@ -267,7 +267,7 @@ def save_snapshot_in_disk(snapshot, path): print(f"workbench: INFO: Snapshot written in path '{filename}'") except Exception as e: try: - print(f"workbench: WARNING: Failed to write in snapshots directory: {e}. Attempting to save in actual path.") + print(f"workbench: WARNING: Attempting to save in actual path. Reason: Failed to write in snapshots directory:\n {e}.") fallback_filename = "{}/{}_{}.json".format( path, datetime.now().strftime("%Y%m%d-%H_%M_%S"), @@ -276,7 +276,7 @@ def save_snapshot_in_disk(snapshot, path): f.write(json.dumps(snapshot)) print(f"workbench: INFO: Snapshot written in fallback path '{fallback_filename}'") except Exception as e: - print(f"workbench: ERROR: Failed to write in fallback path: {e}. Could not save snapshot locally.") + print(f"workbench: ERROR: Could not save snapshot locally. Reason: Failed to write in fallback path:\n {e}") # TODO sanitize url, if url is like this, it fails # url = 'http://127.0.0.1:8000/api/snapshot/'