fix(net): preserve failed session tick stacks
Keep the original exception stack when cleanup succeeds so connected lifecycle failures identify the real packet/event handler instead of the session wrapper. Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
This commit is contained in:
parent
621f70eab6
commit
3f1548b952
2 changed files with 8 additions and 1 deletions
|
|
@ -342,6 +342,8 @@ internal sealed class LiveSessionController
|
||||||
catch (Exception tickError)
|
catch (Exception tickError)
|
||||||
{
|
{
|
||||||
Exception error = StopAfterFailure(tickError);
|
Exception error = StopAfterFailure(tickError);
|
||||||
|
if (ReferenceEquals(error, tickError))
|
||||||
|
throw;
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -805,11 +805,16 @@ public sealed class LiveSessionControllerTests
|
||||||
controller.Start(LiveOptions(), host);
|
controller.Start(LiveOptions(), host);
|
||||||
WorldSession session = operations.Sessions[0];
|
WorldSession session = operations.Sessions[0];
|
||||||
|
|
||||||
Assert.Throws<InvalidOperationException>(controller.Tick);
|
InvalidOperationException error =
|
||||||
|
Assert.Throws<InvalidOperationException>(controller.Tick);
|
||||||
|
|
||||||
Assert.False(controller.IsInWorld);
|
Assert.False(controller.IsInWorld);
|
||||||
Assert.Null(controller.CurrentSession);
|
Assert.Null(controller.CurrentSession);
|
||||||
Assert.Equal(1, operations.DisposeCounts[session]);
|
Assert.Equal(1, operations.DisposeCounts[session]);
|
||||||
|
Assert.Contains(
|
||||||
|
$"{nameof(TestOperations)}.{nameof(TestOperations.Tick)}",
|
||||||
|
error.StackTrace,
|
||||||
|
StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue