Skip to content

Update System.Exception.StackTrace remark to reflect the new behavior for rethrown exceptions #3297

@ateoi

Description

@ateoi

The line below needs to be updated to reflect the fix for dotnet/coreclr#15780 and implemented by dotnet/coreclr#16464. This change is expected to be included in .NET Core 2.1 - https://github.com/dotnet/coreclr/issues/15780#issuecomment-368585175.

This is the new behavior for rethrown exceptions:

  1. Exception rethrown in a method 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 where the method that threw the exception was called.

  2. Exception is thrown and later rethrown in the same method: the stack trace only contains the location where the exception was originally thrown and does not include the location where the exception was rethrown.

https://github.com/dotnet/docs/blob/f66fe50bf0c637bfd9ca305c7ca30c3f37e50620/xml/System/Exception.xml#L1061

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri1Indicates issues/PRs that are high priorityPri3Indicates issues/PRs that are low priorityarea-System.Runtimedoc-bugProblem with the content; needs to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions