Skip to content

Commit

Permalink
[FAB-3466] Error Handling
Browse files Browse the repository at this point in the history
small tweak to doc
add to TOC
[ci-skip]

Change-Id: I9e69191607405c98c069a00c970b752585379597
Signed-off-by: Nick Gaski <ngaski@us.ibm.com>
  • Loading branch information
nickgaski committed Apr 27, 2017
1 parent ca3a1a2 commit 4141f89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/source/error-handling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Error handling
General Overview
----------------
The Fabric error handling framework can be found in the Fabric repository under
common/errors. It defines a new type of error, CallStackError, to use in place of
the standard error type provided by Go.
**common/errors**. It defines a new type of error, CallStackError, to use in
place of the standard error type provided by Go.

A CallStackError consists of the following:

Expand All @@ -26,19 +26,17 @@ components for those using an editor with code completion capabilities.
- Reason code - a short code to help identify the reason the error occurred.
Reason codes should consist of three numeric values. Letters and special
characters are not allowed.

- Error code - the component code and reason code separated by a colon,
e.g. PER:404

- Error message - the text that describes the error. This is the same as the
input provided to ``fmt.Errorf()`` and ``Errors.New()``. If an error has been
wrapped into the current error, its message will be appended.

- Callstack - the callstack at the time the error is created. If an error has
been wrapped into the current error, its error message and callstack will be
appended to retain the context of the wrapped error.

The CallStackError interface exposes the following functions:

- Error() - returns the error message with callstack appended
- Message() - returns the error message (without callstack appended)
- GetComponentCode()
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Before diving in, watch how Fabric is `Building a Blockchain for Business <https
configtx
configtxgen
cc-packaging-and-signing
error-handling
Setup/logging-control

.. toctree::
Expand Down

0 comments on commit 4141f89

Please sign in to comment.