We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3223396 commit 25b3475Copy full SHA for 25b3475
lua/plenary/async/util.lua
@@ -29,15 +29,12 @@ M.block_on = function(async_function, timeout)
29
ret = { ... }
30
end)
31
32
- local function check()
33
- if stat == false then
34
- error("Blocking on future failed " .. unpack(ret))
35
- end
36
- return stat == true
37
+ vim.wait(timeout or 2000, function()
+ return stat ~= nil
+ end, 20, false)
38
39
- if not vim.wait(timeout or 2000, check, 20, false) then
40
- error "Blocking on future timed out or was interrupted"
+ if stat == false then
+ error(string.format("Blocking on future timed out or was interrupted.\n%s", unpack(ret)))
41
end
42
43
return unpack(ret)
0 commit comments