Skip to content

Commit b99a6be

Browse files
committed
Unwrap TargetInvocationException
1 parent 275c9ff commit b99a6be

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/NHibernate/Impl/ExpressionProcessor.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,14 @@ public static object FindValue(Expression expression)
273273
}
274274

275275
var valueExpression = Expression.Lambda(expression).Compile();
276-
object value = valueExpression.DynamicInvoke();
277-
return value;
276+
try
277+
{
278+
return valueExpression.DynamicInvoke();
279+
}
280+
catch (TargetInvocationException ex)
281+
{
282+
throw ReflectHelper.UnwrapTargetInvocationException(ex);
283+
}
278284
}
279285

280286
/// <summary>

0 commit comments

Comments
 (0)