You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2025/12/08 23:12:01 UTC

svn commit: r1930373 - comdev/reporter.apache.org/trunk/scripts/rapp

Author: sebb
Date: Mon Dec  8 23:12:00 2025
New Revision: 1930373

Log:
Detect missing cache file

Modified:
   comdev/reporter.apache.org/trunk/scripts/rapp/whimsy.py

Modified: comdev/reporter.apache.org/trunk/scripts/rapp/whimsy.py
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/rapp/whimsy.py	Mon Dec  8 22:24:48 2025	(r1930372)
+++ comdev/reporter.apache.org/trunk/scripts/rapp/whimsy.py	Mon Dec  8 23:12:00 2025	(r1930373)
@@ -3,6 +3,7 @@
 """ script for publishing a report to whimsy """
 # This is part of a gunicorn app (not intended for standalone use)
 
+import os
 import json
 import requests
 import re
@@ -70,8 +71,14 @@ def get_whimsy(url, env, ttl = 14400):
                 json.dump(js, f)
                 f.close()
                 cached = False
-        except: # fall back to cache on failure!
-            js = json.load(open(wanted_file))
+        except Exception as e: # fall back to cache on failure!
+            print(f"Failed to fetch {url}: {e}")
+            if os.path.exists(wanted_file):
+                print(f"Using stale cache for {wanted_file}")
+                js = json.load(open(wanted_file))
+            else:
+                print(f"No cache for {wanted_file}")
+                raise
     
     return js, cached