From 79925785a2dd60b428772bad7d7d8c18467b8914 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Thu, 11 Jun 2009 16:17:36 +0200 Subject: [PATCH] improve assert_type() error message a bit --- generic/e2lib.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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") -- 2.39.5