Skip to content

Commit aa53304

Browse files
committed
hotfix: log expression when failing to analyze expression
1 parent 9243578 commit aa53304

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/FluentAssertions.Analyzers/Utilities/FluentAssertionsAnalyzer.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ private Diagnostic AnalyzeExpressionSafely(ExpressionSyntax expression, Semantic
9999
}
100100
catch (Exception e)
101101
{
102-
Console.Error.WriteLine($"Failed to analyze expression in {GetType().FullName}.\n{e}");
102+
var expressionString = "UNKNOWN";
103+
try {
104+
expressionString = expression.ToString();
105+
} catch {}
106+
Console.Error.WriteLine($"Failed to analyze expression in {GetType().FullName}. expression: {expressionString}\n{e}");
103107
return null;
104108
}
105109
}

0 commit comments

Comments
 (0)