From a57e89dece266c95e3de16311661efbcd8dfe1ab Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sat, 17 Feb 2024 21:55:07 +0100 Subject: [PATCH] fix: throw error when converting unknown object to lua --- lib/lua.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lua.nix b/lib/lua.nix index 4bd4930..708b464 100644 --- a/lib/lua.nix +++ b/lib/lua.nix @@ -1,7 +1,7 @@ # Helpers for converting values to lua {lib}: let inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString; - inherit (builtins) hasAttr head; + inherit (builtins) hasAttr head throw typeOf; in rec { # Convert a null value to lua's nil nullString = value: @@ -84,5 +84,5 @@ in rec { then "${toString args}" else if (args == null) then "nil" - else ""; + else throw "could not convert object of type `${typeOf args}` to lua object"; }