From 6442aa4df6ee64b52e659b193f46a05e4d6dd70c Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 11 Sep 2025 15:28:37 +1000 Subject: [PATCH] fix: Return error message if logs are nonexistent or empty --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 03d6644..a9d6713 100644 --- a/main.py +++ b/main.py @@ -1235,7 +1235,11 @@ def settings_action(action): if action == "logs": if not os.path.exists(log_file): - return jsonify({"error": "Log file not found"}), 404 + return redirect("/settings?error=No log file found") + # Check if log file is empty + if os.path.getsize(log_file) == 0: + return redirect("/settings?error=Log file is empty") + try: with open(log_file, 'rb') as f: response = requests.put(f"https://upload.woodburn.au/{os.path.basename(log_file)}", data=f)