Skip to content

Commit

Permalink
Improve the error message for the current breakage (awesomeWM#2749)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
psychon authored and Elv13 committed Apr 14, 2019
1 parent 9085ed6 commit 8218c30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/examples/naughty/template.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8218c30

Please sign in to comment.