fix: Don't assert on exception in BooleanExpression.evaluate

Bugs (fixed):
  * DataStream WebApp Server sometimes crashes when the user enters a
    bad query.
This commit is contained in:
John Colvin committed 2025-08-24 13:46:50 -04:00
1 parent bb7a000689
commit cdebdd5765
1 file changed
+2 -10
@@ -1,19 +1,11 @@
namespace Bts.BooleanExpressions;
using bts;
class BooleanExpression : IBooleanExpression {
readonly Func<IDictionary<string, object?>, bool> evaluate;
public BooleanExpression(Func<IDictionary<string, object?>, bool> evaluate) =>
this.evaluate = evaluate;
public bool Evaluate(IDictionary<string, object?> env) {
try {
return evaluate(env);
} catch (Exception ex) {
Log.assert(false, $"BooleanExpression.Evaluate failed: {ex}");
throw;
}
}
public bool Evaluate(IDictionary<string, object?> env) =>
evaluate(env);
}