aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-09-01 15:51:02 -0700
committerJustin M. Keyes <justinkz@gmail.com>2019-09-01 22:49:33 -0700
commit78ec7981c8e931fe72998b0cbe144304d6506803 (patch)
treef2a8fc75f4724a62c8990d63b9a6261a4fb70a72 /test/functional/ui/screen.lua
parentc062149d5bee8ae12d1bb3280e8ad01b1c6e9461 (diff)
downloadrneovim-78ec7981c8e931fe72998b0cbe144304d6506803.tar.gz
rneovim-78ec7981c8e931fe72998b0cbe144304d6506803.tar.bz2
rneovim-78ec7981c8e931fe72998b0cbe144304d6506803.zip
screen.lua: dump payload on handler failure
For debugging failures like: test/functional/helpers.lua:240: test/functional/ui/screen.lua:898: bad argument #1 to 'unpack' (table expected, got number) test/functional/helpers.lua:240: test/functional/ui/screen.lua:708: attempt to index local 'item' (a number value) ref #10804
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 02be714e0d..0e3b903398 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -615,7 +615,12 @@ function Screen:_redraw(updates)
local handler_name = '_handle_'..method
local handler = self[handler_name]
if handler ~= nil then
- handler(self, unpack(update[i]))
+ local status, res = pcall(handler, self, unpack(update[i]))
+ if not status then
+ error(handler_name..' failed'
+ ..'\n payload: '..inspect(update)
+ ..'\n error: '..tostring(res))
+ end
else
assert(self._on_event,
"Add Screen:"..handler_name.." or call Screen:set_on_event_handler")