Try except.. everything.

This commit is contained in:
Casper V. Kristensen 2019-04-06 01:31:45 +02:00
parent b3b3303213
commit 55df1c20ee
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -21,7 +21,11 @@ def probabilities():
probs = [] probs = []
for name, (weight, strategy) in strategies.items(): 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({ probs.append({
"name": name, "name": name,
"doc": inspect.getdoc(strategy), "doc": inspect.getdoc(strategy),