From 9be615df177b03c14aeb72b8c6c9a88fadd3cb9d Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Sun, 3 Nov 2024 05:04:17 +0000 Subject: [PATCH] differentiate between failing and missing actions in error message --- lua/octo/commands.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/octo/commands.lua b/lua/octo/commands.lua index 69855128..529fca51 100644 --- a/lua/octo/commands.lua +++ b/lua/octo/commands.lua @@ -434,10 +434,15 @@ function M.octo(object, action, ...) end local a = o[action] or o - if not pcall(a, ...) then + if not a then utils.error(action and "Incorrect action: " .. action or "No action specified") return end + res = pcall(a, ...) + if not res then + utils.error(action and "Failed action: " .. action) + return + end end end