Skip to content

fix: route the remaining simulated system errors through the exception factory - #1147

Merged
vbreuss merged 1 commit into
mainfrom
fix/route-errors-through-exception-factory
Oct 18, 2026
Merged

vbreuss merged 1 commit into
mainfrom
fix/route-errors-through-exception-factory

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 18, 2026

Copy link
Copy Markdown
Member

Some simulated system errors were built inline and their messages differed from the real system, which tests that only pinned the exception type, parameter name or HResult did not notice. They now go through ExceptionFactory and the tests pin the messages against the real system.

  • Invalid timer dueTime and period use the real message for the target framework (ThrowIfLessThan style on .NET 8+, with the trailing period before).
  • Timer.Change on a disposed timer (before .NET 8) no longer adds an object name, an invalid SearchOption reports "Enum value was out of legal range." and the EnumerationOptions polyfill reports "Non-negative number required.".
  • A search pattern with more ../ than parent directories throws "Access to the path '...' is denied." for the root instead of an invented message.
  • The closed file stream and the read-only directory delete errors keep their behaviour and only move into the factory.

…n factory

Some simulated system errors were built inline and their messages differed from the real system, which tests that only pinned the exception type, parameter name or HResult did not notice. They now go through `ExceptionFactory` and the tests pin the messages against the real system.

- Invalid timer `dueTime` and `period` use the real message for the target framework (`ThrowIfLessThan` style on .NET 8+, with the trailing period before).
- `Timer.Change` on a disposed timer (before .NET 8) no longer adds an object name, an invalid `SearchOption` reports "Enum value was out of legal range." and the `EnumerationOptions` polyfill reports "Non-negative number required.".
- A search pattern with more `../` than parent directories throws "Access to the path '...' is denied." for the root instead of an invented message.
- The closed file stream and the read-only directory delete errors keep their behaviour and only move into the factory.
@vbreuss vbreuss self-assigned this Oct 18, 2026
Copilot AI balanced review requested due to automatic review settings October 18, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sonarqubecloud

Copy link
Copy Markdown

@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@github-actions

Copy link
Copy Markdown

Test Results

     62 files       62 suites   1h 15m 46s ⏱️
 66 152 tests  62 658 ✅  3 494 💤 0 ❌
151 251 runs  136 523 ✅ 14 728 💤 0 ❌

Results for commit 16d4129.

@vbreuss
vbreuss merged commit 688c44f into main Oct 18, 2026
16 checks passed
@vbreuss
vbreuss deleted the fix/route-errors-through-exception-factory branch October 18, 2026 23:31
@github-actions

Copy link
Copy Markdown

This is addressed in release v7.1.2.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants