Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Exception.StackTrace nullability #8739

Merged
merged 6 commits into from
Nov 8, 2023
Merged

Document Exception.StackTrace nullability #8739

merged 6 commits into from
Nov 8, 2023

Conversation

colejohnson66
Copy link
Contributor

Fixes #8728.

Summary

Exception.StackTrace returns a nullable string?, but it is not documented when it will be null. Testing confirms that it's null before being thrown.

// prints `True`
Console.WriteLine((new Exception()).StackTrace is null);

// prints `False`
try
{
    throw new Exception();
}
catch (Exception ex)
{
    Console.WriteLine(ex.StackTrace is null);
}

@colejohnson66 colejohnson66 requested a review from a team as a code owner December 25, 2022 02:12
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Dec 25, 2022
@learn-build-service-prod

This comment was marked as outdated.

xml/System/Exception.xml Outdated Show resolved Hide resolved
@learn-build-service-prod
Copy link

Learn Build status updates of commit 8a4fd85:

✅ Validation status: passed

File Status Preview URL Details
xml/System/Exception.xml ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@greenEkatherine greenEkatherine requested review from a team and gewarren December 30, 2022 14:29
xml/System/Exception.xml Outdated Show resolved Hide resolved
Co-authored-by: Genevieve Warren <[email protected]>
@learn-build-service-prod
Copy link

Learn Build status updates of commit 9f15c39:

✅ Validation status: passed

File Status Preview URL Details
xml/System/Exception.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@learn-build-service-prod
Copy link

Learn Build status updates of commit 60779fa:

✅ Validation status: passed

File Status Preview URL Details
xml/System/Exception.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@learn-build-service-prod
Copy link

Learn Build status updates of commit 9c12ec1:

✅ Validation status: passed

File Status Preview URL Details
xml/System/Exception.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@learn-build-service-prod
Copy link

Learn Build status updates of commit ca15d08:

✅ Validation status: passed

File Status Preview URL Details
xml/System/Exception.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gewarren gewarren merged commit f8aab18 into dotnet:main Nov 8, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception.StackTrace does not explain how it could be null
3 participants