mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(api): not using TRY_WRAP, generic error messages #31595
Problem: - API functions using `try_start` directly instead of `TRY_WRAP`, do not surface the underlying error message, and instead show generic things like "Failed to set buffer". - Error handling code is duplicated in the API impl, instead of delegating to the vim buffer/window handling logic. Solution: - Use `TRY_WRAP`.
This commit is contained in:
@@ -1664,7 +1664,7 @@ describe('API/win', function()
|
||||
autocmd BufWinEnter * ++once let fired = v:true
|
||||
]])
|
||||
eq(
|
||||
'Failed to set buffer 2',
|
||||
'Vim:E37: No write since last change (add ! to override)',
|
||||
pcall_err(api.nvim_open_win, api.nvim_create_buf(true, true), false, { split = 'left' })
|
||||
)
|
||||
eq(false, eval('fired'))
|
||||
|
||||
Reference in New Issue
Block a user