[gh-88] Added exception widget for top level exceptions.
This commit is contained in:
Родитель
7d8644575b
Коммит
e5e023d166
|
@ -97,6 +97,10 @@ namespace SharpLab.Server.Execution {
|
|||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
if (ex is TargetInvocationException invocationEx)
|
||||
ex = invocationEx.InnerException;
|
||||
|
||||
Flow.ReportException(ex);
|
||||
return new ExecutionResult(ex, Flow.Lines);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace SharpLab.Tests {
|
|||
|
||||
[Theory]
|
||||
[InlineData("Exceptions.CatchDivideByZero.cs", 5, "DivideByZeroException")]
|
||||
[InlineData("Exceptions.DivideByZero.cs", 4, "DivideByZeroException")]
|
||||
public async Task SlowUpdate_ReportsExceptionInFlow(string resourceName, int expectedLineNumber, string expectedExceptionTypeName) {
|
||||
var driver = await NewTestDriverAsync(LoadCodeFromResource(resourceName));
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
public class C {
|
||||
public void M() {
|
||||
var x = 0;
|
||||
var y = x / 0;
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Compile Remove="TestCode\Execution\Exceptions.CatchDivideByZero.cs" />
|
||||
<Compile Remove="TestCode\Execution\Exceptions.DivideByZero.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -33,6 +34,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="TestCode\Execution\Exceptions.DivideByZero.cs" />
|
||||
<EmbeddedResource Include="TestCode\Execution\Exceptions.CatchDivideByZero.cs" />
|
||||
<EmbeddedResource Include="TestCode\Variable.FromArgumentToCall.cs2cs" />
|
||||
</ItemGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче