From 8218c30a84445c439257ef20f39207875c78c65b Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 14 Apr 2019 19:44:05 +0200 Subject: [PATCH] Improve the error message for the current breakage (#2749) The tests for naughty are currently broken, because naughty.dbus now uses Gio for interacting with DBus, but the tests still try to use awesome's dbus object. Turn the resulting weird error into something a lot less cryptic. Signed-off-by: Uli Schlachter --- tests/examples/naughty/template.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/examples/naughty/template.lua b/tests/examples/naughty/template.lua index 1c2314f0f..ca51770dd 100644 --- a/tests/examples/naughty/template.lua +++ b/tests/examples/naughty/template.lua @@ -18,6 +18,14 @@ end local rect = {x1 = math.huge ,y1 = math.huge , x2 = -math.huge , y2 = -math.huge} +if #drawin.get() == 0 then + -- The code below would calculate -math.huge - math.huge and end up trying + -- to draw something of size -math.huge times -math.huge. Turn this weird + -- error into a better error message. + error("Got no drawins to draw. " + .. "That's not good and would cause errors later on.") +end + -- Get the region with wiboxes for _, d in ipairs(drawin.get()) do local w = d.get_wibox and d:get_wibox() or nil