Author: sebb
Date: Sun Jun 22 12:53:34 2025
New Revision: 1926640

URL: http://svn.apache.org/viewvc?rev=1926640&view=rev
Log:
Log more info on failure

Modified:
    comdev/reporter.apache.org/trunk/scripts/mailglomper2.py

Modified: comdev/reporter.apache.org/trunk/scripts/mailglomper2.py
URL: 
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/mailglomper2.py?rev=1926640&r1=1926639&r2=1926640&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/mailglomper2.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/mailglomper2.py Sun Jun 22 
12:53:34 2025
@@ -123,7 +123,12 @@ async def weekly_stats(client, listpart,
         return {}
     ldate = date[:4] + "-" + date[4:]  # Convert to lists.a.o format, yyyy-mm
     url = 
f"https://lists.apache.org/api/stats.json?list={listpart}&domain={domainpart}&d={ldate}";
-    mldata = await (await client.get(url)).json()
+    try:
+        mldata = await (await client.get(url)).json()
+    except Exception as err:
+        tsprint(f"Failed fetching {url}: {err}")
+        err.add_note(f"Failed fetching {url}: {err}")
+        raise
     weekly = {}
     count = 0
     if mldata:  # we have a new/updated file to process
@@ -189,6 +194,10 @@ async def gather_stats():
         except KeyboardInterrupt:  # catch the handlers signal
             tsprint("Interrupted processing of %s" % ml)
 
+        except Exception as e:  # add some context
+            e.add_note(f"While processing {listpart}@{domainpart}")
+            raise
+
         if interrupted:
             break
 
@@ -220,4 +229,9 @@ async def gather_stats():
 
 
 if __name__ == "__main__":
-    asyncio.run(gather_stats())
+    try:
+        asyncio.run(gather_stats())
+    except Exception as e:
+        tsprint("Failed: %s" % repr(e))
+        raise # ensure it alerts the mailing list
+        


Reply via email to