Skip to content

Get rid of SysError and WinError derived classes#15284

Draft
Ericson2314 wants to merge 1 commit intomasterfrom
system-error-from
Draft

Get rid of SysError and WinError derived classes#15284
Ericson2314 wants to merge 1 commit intomasterfrom
system-error-from

Conversation

@Ericson2314
Copy link
Member

Motivation

All we need is SystemError, and the various ways to construct it can be done with static methods that are more informative. Catching the derived classes was a footgun that is now impossible, because one can only has SystemError to catch.

I did however make SysError and WinError top-level function wrappers in order to avoid churn in the vast majority of call sites.

Context

Depends on #15283


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

All we need is `SystemError`, and the various ways to construct it can
be done with static methods that are more informative. Catching the
derived classes was a footgun that is now impossible, because one can
only has `SystemError` to catch.

I did however make `SysError` and `WinError` top-level function
wrappers in order to avoid churn in the vast majority of call sites.
@github-actions github-actions bot added new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store repl The Read Eval Print Loop, "nix repl" command and debugger fetching Networking with the outside (non-Nix) world, input locking labels Feb 18, 2026
@dpulls
Copy link

dpulls bot commented Feb 18, 2026

🎉 All dependencies have been resolved !

@Ericson2314
Copy link
Member Author

Drafting because this is not a priority.

@Ericson2314 Ericson2314 marked this pull request as draft February 19, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant