I want to add a unit test that proves that a serialization error causes the stream to be destroyed.
My theory is that a handled error should not destroy the stream, but an unhandled error will. Which is why I added the try/catch here c93856c#diff-a0409bc7afd5cfb092c8a361a87db7551788ea4459b19cfb68d766c6398d4248R39-R53
The question is, how do I create an unhandled error? Might need to test stuff before the mentioned commit.
The outcome of this investigation should tell me if I should create a PR upstream.