api: Implement vim_report_error function

This function is used to report errors caused by remote functions called by
channel_send_call
This commit is contained in:
Thiago de Arruda
2014-09-11 10:35:52 -03:00
parent d29b62daab
commit 15ca58d79f
3 changed files with 20 additions and 12 deletions

View File

@@ -12796,13 +12796,17 @@ static void f_send_call(typval_T *argvars, typval_T *rettv)
return;
}
if (errored) {
vim_report_error(result.data.string);
goto end;
}
Error conversion_error = {.set = false};
if (errored || !object_to_vim(result, rettv, &conversion_error)) {
EMSG(errored ?
result.data.string.data :
_("Error converting the call result"));
if (!object_to_vim(result, rettv, &conversion_error)) {
EMSG(_("Error converting the call result"));
}
end:
api_free_object(result);
}