diff options
author | Fedor Indutny <fedor@indutny.com> | 2016-06-04 14:37:26 -0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2016-06-04 15:44:18 -0400 |
commit | af170cc9bbfbed228c386b64c1bb945ab4a502ed (patch) | |
tree | 901e5758c4ff05f72826c7e616591c7a548690e8 /docs | |
parent | a66bb042e02bd1021a574c32a27fff087ab1c9f4 (diff) | |
download | uv_link_t-af170cc9bbfbed228c386b64c1bb945ab4a502ed.tar.gz |
api: experimental error reporting
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api.md | 24 | ||||
-rw-r--r-- | docs/implementation-guide.md | 4 |
2 files changed, 28 insertions, 0 deletions
diff --git a/docs/api.md b/docs/api.md index 2d2877b..0d7e634 100644 --- a/docs/api.md +++ b/docs/api.md @@ -118,6 +118,16 @@ Invoke `shutdown` from the link's [`uv_link_methods_t`][]. Acts similarly to `uv_shutdown()`. `cb(uv_link_t* link, int status, void* arg)` is invoked on completion. +### const char* uv_link_strerror(...) + +* `uv_link_t* link` +* `int err` - error code, previously either returned the one of the + `uv_link...` methods or passed as a negative `nread` to `link->read_cb` + +Invoke `strerror` from the link's [`uv_link_methods_t`][]. Acts similarly to +`uv_strerror()`. Returns a description of error code that has just been given +back to the user. + ### void uv_link_propagate_alloc_cb(...) Should be used only by [`uv_link_methods_t`][] implementation. @@ -291,6 +301,7 @@ int uv_link_default_shutdown(uv_link_t* link, void* arg); void uv_link_default_close(uv_link_t* link, uv_link_t* source, uv_link_close_cb cb); +const char* uv_link_default_strerror(uv_link_t* link, int err); ``` These maybe used for [`uv_methods_talloc_cb_override`][] and @@ -385,6 +396,18 @@ is passed only only for internal operation. *NOTE: semantics are the same as of `uv_close`.* +### .strerror + +```c +const char* (*strerror)(uv_link_t* link, int err); +``` + +Invoked by [`uv_link_strerror()`][]. + +Should return a description string of the `err` that was emitted by the `link`. + +*NOTE: semantics are the same as of `uv_strerror`.* + ### .alloc_cb_override A method used to override that value of [`uv_link_t.alloc_cb`][] by @@ -468,6 +491,7 @@ Invoked by `uv_link_propagate_read_cb`. MUST not manage the data in `buf`. [`uv_link_chain()`]: #int-uv_link_chain [`uv_link_close()`]: #void-uv_link_close +[`uv_link_strerror()`]: #const-char-uv_link_strerror [`uv_link_init()`]: #int-uv_link_init [`uv_link_methods_t`]: #uv_link_methods_t [`uv_link_observer_t.observer_read_cb`]: #observer_read_cb diff --git a/docs/implementation-guide.md b/docs/implementation-guide.md index 9393bdc..65fb8fe 100644 --- a/docs/implementation-guide.md +++ b/docs/implementation-guide.md @@ -3,6 +3,10 @@ `uv_link_t` behaves very similar to [`uv_stream_t`][0]. All `uv_link_methods_t` MUST conform to this semantics. +## Error Codes + +All error codes MUST be negative and be less than `UV_ERRNO_MAX`. + ## uv_link_init() Links start in non-reading mode, `alloc_cb`/`read_cb` MUST NOT be called until |