]> git.e2factory.org Git - e2factory.git/commitdiff
improve assert_type() error message a bit
authorTobias Ulmer <tu@emlix.com>
Thu, 11 Jun 2009 14:17:36 +0000 (16:17 +0200)
committerGordon Hecker <gh@emlix.com>
Tue, 16 Jun 2009 08:13:29 +0000 (10:13 +0200)
generic/e2lib.lua

index 7b7848d5bc6fda2b79e1b494cb53359b9642bf61..6499ba96029fb2970847aa47f586d07b8daf042f 100644 (file)
@@ -866,9 +866,11 @@ function e2lib.use_global_config()
                                tostring(config.site.buildnumber_server_url)))
   end
   -- check if type(x) == t, and abort if not.
-  local function assert_type(x, d, t)
-    if type(x) ~= t then
-      e2lib.abort(string.format("configuration error: %s", d))
+  local function assert_type(x, d, t1)
+    local t2 = type(x)
+    if t1 ~= t2 then
+      e2lib.abort(
+        string.format("configuration error: %s (expected %s got %s)", d, t1, t2))
     end
   end
   assert_type(config.site, "config.site", "table")