mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +00:00
feat(api): show more exception info
This commit is contained in:
@@ -150,7 +150,18 @@ bool try_end(Error *err)
|
|||||||
xfree(msg);
|
xfree(msg);
|
||||||
}
|
}
|
||||||
} else if (did_throw) {
|
} else if (did_throw) {
|
||||||
api_set_error(err, kErrorTypeException, "%s", current_exception->value);
|
if (*current_exception->throw_name != NUL) {
|
||||||
|
if (current_exception->throw_lnum != 0) {
|
||||||
|
api_set_error(err, kErrorTypeException, "%s, line %" PRIdLINENR ": %s",
|
||||||
|
current_exception->throw_name, current_exception->throw_lnum,
|
||||||
|
current_exception->value);
|
||||||
|
} else {
|
||||||
|
api_set_error(err, kErrorTypeException, "%s: %s",
|
||||||
|
current_exception->throw_name, current_exception->value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
api_set_error(err, kErrorTypeException, "%s", current_exception->value);
|
||||||
|
}
|
||||||
discard_current_exception();
|
discard_current_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ describe('autocmd TermClose', function()
|
|||||||
local function test_termclose_delete_own_buf()
|
local function test_termclose_delete_own_buf()
|
||||||
command('autocmd TermClose * bdelete!')
|
command('autocmd TermClose * bdelete!')
|
||||||
command('terminal')
|
command('terminal')
|
||||||
matches('^Vim%(bdelete%):E937: Attempt to delete a buffer that is in use: term://',
|
matches('^TermClose Autocommands for "%*": Vim%(bdelete%):E937: Attempt to delete a buffer that is in use: term://',
|
||||||
pcall_err(command, 'bdelete!'))
|
pcall_err(command, 'bdelete!'))
|
||||||
assert_alive()
|
assert_alive()
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user