mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 21:37:43 +00:00
API: emit nvim_error_event on failed async request
We already do this for _invalid_ async requests #9300. Now we also do it for failed invocation of valid requests.
This commit is contained in:
@@ -49,13 +49,23 @@ describe('API', function()
|
||||
|
||||
it('handles errors in async requests', function()
|
||||
local error_types = meths.get_api_info()[2].error_types
|
||||
nvim_async("bogus")
|
||||
nvim_async('bogus')
|
||||
eq({'notification', 'nvim_error_event',
|
||||
{error_types.Exception.id, 'Invalid method: nvim_bogus'}}, next_msg())
|
||||
-- error didn't close channel.
|
||||
eq(2, eval('1+1'))
|
||||
end)
|
||||
|
||||
it('failed async request emits nvim_error_event', function()
|
||||
local error_types = meths.get_api_info()[2].error_types
|
||||
nvim_async('command', 'bogus')
|
||||
eq({'notification', 'nvim_error_event',
|
||||
{error_types.Exception.id, 'Vim:E492: Not an editor command: bogus'}},
|
||||
next_msg())
|
||||
-- error didn't close channel.
|
||||
eq(2, eval('1+1'))
|
||||
end)
|
||||
|
||||
it('does not set CA_COMMAND_BUSY #7254', function()
|
||||
nvim('command', 'split')
|
||||
nvim('command', 'autocmd WinEnter * startinsert')
|
||||
|
||||
Reference in New Issue
Block a user