channel-exporter: Be a bit more verbose and print more output if things go wrong
Graham Christensen committed
Apr 5, 2020 at 22:13 UTC
655ed333174c2ba57ac76e8d29fad727a47c1fef
1 file changed
+12
-4
delft/eris/channel-exporter.py
+12
-4
@@ -41,11 +41,19 @@ def measure_channel(name):
41
try:
42
with CHANNEL_REQUEST_FAILURES.count_exceptions():
43
result = requests.get(f"https://nixos.org/channels/{name}/git-revision")
44
- return {
45
- "timestamp": parse(result.headers["last-modified"]).timestamp(),
46
- "revision": result.text
47
- }
44
+
45
+ try:
46
+ return {
47
+ "timestamp": parse(result.headers["last-modified"]).timestamp(),
48
+ "revision": result.text
49
+ }
50
+ except KeyError as e:
51
+ print(f"Got KeyError after getting our result for {name}:")
52
+ pprint(e)
53
+ pprint(result)
54
+
55
except Exception as e:
56
+ print(f"Got a mystery error for {name}:")
57
pprint(e)
58
59