diff --git a/lib/strings.nix b/lib/strings.nix index b81a04a6666b..a926edfaeba6 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -2532,8 +2532,9 @@ rec { strw = lib.stringLength str; reqWidth = width - (lib.stringLength filler); in - assert lib.assertMsg (strw <= width) - "fixedWidthString: requested string length (${toString width}) must not be shorter than actual length (${toString strw})"; + assert + strw <= width + || throw "fixedWidthString: requested string length (${toString width}) must not be shorter than actual length (${toString strw})"; if strw == width then str else filler + fixedWidthString reqWidth filler str; /**