From: Tobias Ulmer Date: Thu, 11 Jun 2009 14:17:36 +0000 (+0200) Subject: improve assert_type() error message a bit X-Git-Tag: e2factory-2.3.1~2 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=79925785a2dd60b428772bad7d7d8c18467b8914;p=e2factory.git improve assert_type() error message a bit --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 7b7848d..6499ba9 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -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")