From 55df1c20ee8a39cc957ab9d0be4a3aadf4ca9501 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Sat, 6 Apr 2019 01:31:45 +0200 Subject: [PATCH] Try except.. everything. --- server/nightr/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/nightr/app.py b/server/nightr/app.py index 5ca1031..104a1bd 100644 --- a/server/nightr/app.py +++ b/server/nightr/app.py @@ -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),