From 15ca58d79f8cc8565c1a2b2581029cf7901b5fbd Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 11 Sep 2014 10:35:52 -0300 Subject: api: Implement `vim_report_error` function This function is used to report errors caused by remote functions called by channel_send_call --- src/nvim/os/provider.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/nvim/os/provider.c') diff --git a/src/nvim/os/provider.c b/src/nvim/os/provider.c index e56e33aa1a..9d8f6f297c 100644 --- a/src/nvim/os/provider.c +++ b/src/nvim/os/provider.c @@ -102,7 +102,7 @@ Object provider_call(char *method, Array args) sizeof(buf), "Provider for method \"%s\" is not available", method); - report_error(buf); + vim_report_error(cstr_as_string(buf)); api_free_array(args); return NIL; } @@ -112,7 +112,7 @@ Object provider_call(char *method, Array args) channel_send_call(f->channel_id, method, args, &result, &error); if (error) { - report_error(result.data.string.data); + vim_report_error(result.data.string); api_free_object(result); return NIL; } @@ -151,9 +151,3 @@ static Feature * find_feature(char *name) return NULL; } - -static void report_error(char *str) -{ - vim_err_write((String) {.data = str, .size = strlen(str)}); - vim_err_write((String) {.data = "\n", .size = 1}); -} -- cgit