Skip to content

Hide internal exception throwing details in stacktrace#327

Merged
cbersch merged 1 commit intomainfrom
hide-internal-exception-throwing-details-in-stacktrace
Oct 27, 2025
Merged

Hide internal exception throwing details in stacktrace#327
cbersch merged 1 commit intomainfrom
hide-internal-exception-throwing-details-in-stacktrace

Conversation

@cbersch
Copy link
Copy Markdown
Member

@cbersch cbersch commented Oct 23, 2025

Fixes #326

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
    • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

Legal checklist

  • This work is entirely original, it is not derived from any existing code incompatible with the Apache 2.0 License, like FluentAssertions.

@cbersch cbersch self-assigned this Oct 23, 2025
@cbersch cbersch force-pushed the hide-internal-exception-throwing-details-in-stacktrace branch from 71ec5fc to 15298bb Compare October 23, 2025 14:48
@cbersch cbersch added the enhancement Enhancement of existing feature label Oct 23, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 23, 2025

Test Results

    51 files  ± 0      51 suites  ±0   2m 28s ⏱️ +3s
 6 221 tests + 2   6 221 ✅ + 2  0 💤 ±0  0 ❌ ±0 
38 655 runs  +12  38 655 ✅ +12  0 💤 ±0  0 ❌ ±0 

Results for commit 71643cb. ± Comparison against base commit b2f738d.

This pull request removes 10 and adds 10 tests. Note that renamed tests count towards both.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HaveLength ‑ When_a_throwing_stream_should_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HaveLength ‑ When_a_throwing_stream_should_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HavePosition ‑ When_a_throwing_stream_should_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HavePosition ‑ When_a_throwing_stream_should_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHaveLength ‑ When_a_throwing_stream_should_not_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHaveLength ‑ When_a_throwing_stream_should_not_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHavePosition ‑ When_a_throwing_stream_should_not_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHavePosition ‑ When_a_throwing_stream_should_not_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetLengthExceptionMessage'.)
Object name: 'GetPositionExceptionMessage'.)
AwesomeAssertions.Specs.Execution.AssertionScopeSpecs ‑ No_internal_assertion_defails_appear_in_stacktrace_of_failing_chain
AwesomeAssertions.Specs.Execution.AssertionScopeSpecs ‑ No_internal_assertion_defails_appear_in_stacktrace_of_scope_with_failures
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HaveLength ‑ When_a_throwing_stream_should_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetLengthExceptionMessage'.)
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HaveLength ‑ When_a_throwing_stream_should_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetLengthExceptionMessage'.)
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HavePosition ‑ When_a_throwing_stream_should_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetPositionExceptionMessage'.)
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+HavePosition ‑ When_a_throwing_stream_should_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetPositionExceptionMessage'.)
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHaveLength ‑ When_a_throwing_stream_should_not_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetLengthExceptionMessage'.)
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHaveLength ‑ When_a_throwing_stream_should_not_have_a_length_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetLengthExceptionMessage'.)
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHavePosition ‑ When_a_throwing_stream_should_not_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetPositionExceptionMessage'.)
AwesomeAssertions.Specs.Streams.StreamAssertionSpecs+NotHavePosition ‑ When_a_throwing_stream_should_not_have_a_position_it_should_fail(exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'GetPositionExceptionMessage'.)

♻️ This comment has been updated with latest results.

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 23, 2025

Pull Request Test Coverage Report for Build 18770887138

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 97.487%

Totals Coverage Status
Change from base Build 18675642202: 0.0%
Covered Lines: 12623
Relevant Lines: 12806

💛 - Coveralls

Comment thread Tests/AwesomeAssertions.Specs/Execution/AssertionScopeSpecs.cs Outdated
@cbersch cbersch force-pushed the hide-internal-exception-throwing-details-in-stacktrace branch from 15298bb to 71643cb Compare October 24, 2025 05:47
@sonarqubecloud
Copy link
Copy Markdown

@cbersch cbersch marked this pull request as ready for review October 24, 2025 13:41
Copy link
Copy Markdown
Member

@IT-VBFK IT-VBFK left a comment

Choose a reason for hiding this comment

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

Nice work!

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

Labels

enhancement Enhancement of existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce internal stack trace

4 participants