Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think it depends on what you think "preserves" means. See here [1]:

    If the exception was rethrown in a method that is
    different than the method where it was originally
    thrown, the stack trace contains both the location
    in the method where the exception was originally
    thrown, and the location in the method where the
    exception was rethrown
Putting aside same method/different method, the original stack trace is preserved, but StackTrace is augmented with the location the exception was rethrown.

There's also a code analysis warning for misuses of throw that uses "preserve" in its title [2].

It says in your profile that you work on Roslyn and I imagine you're familiar with how the exception syntax works with the CLR, so maybe you know something I don't know.

[1] http://msdn.microsoft.com/en-us/library/system.exception.sta...

[2] http://msdn.microsoft.com/en-us/library/ms182363.aspx



It says in your profile that you work on Roslyn and I imagine you're familiar with how the exception syntax works with the CLR, so maybe you know something I don't know.

I do, actually. :)

See https://news.ycombinator.com/item?id=7542701.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: