1 write to Exception
Microsoft.CodeAnalysis (1)
SourceGeneration\RunResults.cs (1)
101this.Exception = exception;
34 references to Exception
Microsoft.CodeAnalysis (1)
SourceGeneration\RunResults.cs (1)
119/// When generation fails due to an <see cref="Exception"/> being thrown, a single diagnostic is added
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (33)
SourceGeneration\GeneratorDriverTests.cs (18)
566Assert.Null(result.Exception); 599Assert.Null(result.Exception); 633Assert.Null(result1.Exception); 639Assert.Null(result2.Exception); 644Assert.Null(result3.Exception); 685Assert.Null(result1.Exception); 691Assert.Null(result2.Exception); 1074Assert.Null(result.Exception); 1107Assert.Null(result1.Exception); 1113Assert.Null(result2.Exception); 1118Assert.Null(result3.Exception); 1457Assert.Equal(e, runResults.Results[0].Exception); 1482Assert.Equal(e, runResults.Results[0].Exception); 1525Assert.Equal(e, runResults.Results.Single().Exception); 1554Assert.Equal(e, runResults.Results[0].Exception); 1587Assert.Equal(e, runResults.Results[0].Exception); 4583Assert.IsType<ArgumentException>(result.Exception); 4636var exception = Assert.IsType<InvalidOperationException>(result.Exception);
SourceGeneration\SyntaxAwareGeneratorTests.cs (15)
390Assert.NotNull(results.Results[0].Exception); 391Assert.Equal("Test Exception", results.Results[0].Exception?.Message); 432Assert.NotNull(results.Results[0].Exception); 433Assert.Equal("Test Exception", results.Results[0].Exception?.Message); 522Assert.NotNull(results.Results[0].Exception); 523Assert.Equal("Test Exception", results.Results[0].Exception?.Message); 1869Assert.NotNull(results.Results[0].Exception); 1870Assert.Equal("Test Exception", results.Results[0].Exception?.Message); 1910Assert.NotNull(results.Results[0].Exception); 1911Assert.Equal("Test Exception", results.Results[0].Exception?.Message); 1956Assert.NotNull(results.Results[0].Exception); 1957Assert.Equal("Test Exception", results.Results[0].Exception?.Message); 1960Assert.Null(results.Results[1].Exception); 2060Assert.IsType<OperationCanceledException>(results.Results[0].Exception); 2061Assert.Equal("Simulated cancellation from external source", results.Results[0].Exception!.Message);