Try except.. everything.

This commit is contained in:
Casper 2019-04-06 01:31:45 +02:00
parent b3b3303213
commit 55df1c20ee
No known key found for this signature in database
GPG Key ID: 289CA03790535054

View File

@ -21,7 +21,11 @@ def probabilities():
probs = []
for name, (weight, strategy) in strategies.items():
prob = strategy(phone_data)
try:
prob = strategy(phone_data)
except Exception as e:
print(f"Strategy {name} failed: {e}")
continue
probs.append({
"name": name,
"doc": inspect.getdoc(strategy),