-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
throw vs assert in packages #154292
Copy link
Copy link
Open
Labels
2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Description
@roberth I feel like we are moving in two different directions here, and we should standardize on one of them.
nixpkgs/pkgs/tools/networking/connman/connman.nix
Lines 52 to 53 in 92b09d4
| assert lib.asserts.assertOneOf "firewallType" firewallType [ "iptables" "nftables" ]; | |
| assert lib.asserts.assertOneOf "dnsType" dnsType [ "internal" "systemd-resolved" ]; |
^ this was the way most packages wrote assertions so far, and lib.asserts was just a slight improvement over assert.
The new approach is different and diverges from the previous best practice.
Originally posted by @Profpatsch in #153740 (comment)
cc @roberth
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Fields
Give feedbackNo fields configured for issues without a type.