@@ -75,28 +75,35 @@ public static Expression<Func<T, bool>> BuildPredicate(string path, Comparison c
7575
7676 static Expression MakePredicateBody ( string path , Comparison comparison , string ? [ ] ? values , bool negate )
7777 {
78- Expression expressionBody ;
79-
80- // If path includes list property access
81- if ( HasListPropertyInPath ( path ) )
82- {
83- // Handle a list path
84- expressionBody = ProcessList ( path , comparison , values ! ) ;
85- }
86- // Otherwise linear property access
87- else
78+ try
8879 {
89- // Just get expression
90- expressionBody = GetExpression ( path , comparison , values ) ;
91- }
80+ Expression expressionBody ;
81+
82+ // If path includes list property access
83+ if ( HasListPropertyInPath ( path ) )
84+ {
85+ // Handle a list path
86+ expressionBody = ProcessList ( path , comparison , values ! ) ;
87+ }
88+ // Otherwise linear property access
89+ else
90+ {
91+ // Just get expression
92+ expressionBody = GetExpression ( path , comparison , values ) ;
93+ }
9294
93- // If the expression should be negated
94- if ( negate )
95+ // If the expression should be negated
96+ if ( negate )
97+ {
98+ expressionBody = NegateExpression ( expressionBody ) ;
99+ }
100+
101+ return expressionBody ;
102+ }
103+ catch ( Exception exception )
95104 {
96- expressionBody = NegateExpression ( expressionBody ) ;
105+ throw new ( $ "Failed to build expression. Path: { path } , Comparison: { comparison } , Negate: { negate } , " , exception ) ;
97106 }
98-
99- return expressionBody ;
100107 }
101108
102109 static Expression ProcessList ( string path , Comparison comparison , string ? [ ] ? values )
0 commit comments