api/msgpack-rpc: Improve error infrastructure

- Add error type information to `Error`
- Rename `set_api_error` to `api_set_error` for consistency with other api_*
  functions/macros.
- Refactor the api_set_error macro to accept formatted strings and error types
- Improve error messages
- Wrap error messages with gettext macro
- Refactor msgpack-rpc serialization to transform Error instances into [type,
  message] arrays
- Add error type information to API metadata
- Normalize nvim->client and client->nvim error handling(change
  channel_send_call to accept an Error pointer instead of the `errored` boolean
  pointer)
- Use macro to initialize Error structures
This commit is contained in:
Thiago de Arruda
2014-09-17 08:56:59 -03:00
parent 67a16384a4
commit 4a8b52ea08
11 changed files with 201 additions and 146 deletions

View File

@@ -116,7 +116,7 @@ Window tabpage_get_window(Tabpage tabpage, Error *err)
/// @return true if the tab page is valid, false otherwise
Boolean tabpage_is_valid(Tabpage tabpage)
{
Error stub = {.set = false};
Error stub = ERROR_INIT;
return find_tab_by_handle(tabpage, &stub) != NULL;
}