Skip to content

Commit ea33575

Browse files
sudo-teeCopilot
andauthored
feat: better errors in promise finally
Co-authored-by: Copilot <[email protected]>
1 parent 4e1b968 commit ea33575

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/opencode/promise.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ function Promise:finally(callback)
193193
local new_promise = Promise.new()
194194

195195
local handle_finally = function()
196-
local ok, _ = pcall(callback)
196+
local ok, err = pcall(callback)
197197
-- Ignore callback errors and result, finally doesn't change the promise chain
198198
if not ok then
199199
-- Log error but don't propagate it
200-
vim.notify('Error in finally callback', vim.log.levels.WARN)
200+
vim.notify('Error in finally callback: ' .. tostring(err), vim.log.levels.WARN)
201201
end
202202
end
203203

0 commit comments

Comments
 (0)