Skip to content

Conversation

@lefth
Copy link

@lefth lefth commented Apr 12, 2018

When an exception is thrown again ("throw ex"), its stack will be
overwritten. Instead, it should be rethrown with its original context.

More info here (Figure 2):
https://msdn.microsoft.com/en-us/magazine/mt620018.aspx

Issue #5

@lefth
Copy link
Author

lefth commented Apr 12, 2018

@svermeulen Can you double check this change? I'm not sure if there's any situation where it's more advantageous to show both stack traces. In that case, we could keep the original exception as an InnerException:

throw new Exception(_exception.Message, _exception);

When an exception is thrown again ("throw ex"), its stack will be
overwritten. Instead, it should be rethrown with its original context.

More info here (Figure 2):
https://msdn.microsoft.com/en-us/magazine/mt620018.aspx

Issue modesttree#5
@svermeulen svermeulen merged commit 9f77669 into modesttree:master May 6, 2018
@svermeulen
Copy link
Contributor

Makes sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants