diff options
author | 2017-03-22 08:27:10 -0700 | |
---|---|---|
committer | 2017-03-22 08:27:10 -0700 | |
commit | 02ee91b7bb8e0bea98b7e002c4097795c8a5da10 (patch) | |
tree | 38f1aa5ae9b998cd7d0b03763d4b1e671b7789b2 /src/core | |
parent | 5c42af696daaab38f31886df7e7b374ea6431470 (diff) | |
parent | 4c2e57df9afb9565dfd8c01272b08f24878de01c (diff) |
Merge pull request #10203 from ncteisen/error-ownership-semantics
Add Error Ownership Doc
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/iomgr/error.h | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index eb953947ae..0e7a7b0a1e 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -45,28 +45,9 @@ extern "C" { #endif /// Opaque representation of an error. -/// Errors are refcounted objects that represent the result of an operation. -/// Ownership laws: -/// if a grpc_error is returned by a function, the caller owns a ref to that -/// instance -/// if a grpc_error is passed to a grpc_closure callback function (functions -/// with the signature: -/// void (*f)(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error)) -/// then those functions do not own a ref to error (but are free to manually -/// take a reference). -/// if a grpc_error is passed to *ANY OTHER FUNCTION* then that function takes -/// ownership of the error -/// Errors have: -/// a set of ints, strings, and timestamps that describe the error -/// always present are: -/// GRPC_ERROR_STR_FILE, GRPC_ERROR_INT_FILE_LINE - source location the error -/// was generated -/// GRPC_ERROR_STR_DESCRIPTION - a human readable description of the error -/// GRPC_ERROR_TIME_CREATED - a timestamp indicating when the error happened -/// an error can also have children; these are other errors that are believed -/// to have contributed to this one. By accumulating children, we can begin -/// to root cause high level failures from low level failures, without having -/// to derive execution paths from log lines +/// See https://github.com/grpc/grpc/blob/master/doc/core/grpc-error.md for a +/// full write up of this object. + typedef struct grpc_error grpc_error; typedef enum { |