Skip to content

Commit bdf2273

Browse files
phanenibhagwan
authored andcommitted
fix(pipe_connect): only show warnings on errno
pressing ctrl-g repeatly also have similar error, maybe sometimes `nvim -l` process is killed before connected error in this luv callback won't abort anything but the multi-line stacktrace may cause hit enter prompt so let's change log level to warns
1 parent de0e736 commit bdf2273

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/fzf-lua/shell.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ function M.pipe_wrap_fn(fn, fzf_field_index, debug)
139139
utils.get_info().selected = args[1] and args[1][1] or nil
140140
uv.pipe_connect(pipe, pipe_path, function(err)
141141
if err then
142-
error(string.format("pipe_connect(%s) failed with error: %s", pipe_path, err))
142+
---@diagnostic disable-next-line: undefined-field
143+
err = uv.translate_sys_error(uv.errno[err])
144+
utils.warn(string.format("pipe_connect(%s) failed with error: %s", pipe_path, err))
143145
else
144146
vim.schedule(function()
145147
fn(pipe, unpack(args))

0 commit comments

Comments
 (0)