Documentation
¶
Overview ¶
Package multi is an error type that holds multiple errors. These errors typically originate from operations that target multiple nodes. For example, a transaction proposal with two endorsers could return a multi error type if both endorsers return errors
Example ¶
errs := Errors{}
errs = append(errs, fmt.Errorf("peer0 failed"))
errs = append(errs, fmt.Errorf("peer1 failed"))
// Multi errors implement the standard error interface and are returned as regular errors
err := interface{}(errs).(error)
// We can extract multi errors from a standard error
errs, ok := err.(Errors)
fmt.Println(ok)
// And handle each error individually
for _, e := range errs {
fmt.Println(e)
}
Output: true peer0 failed peer1 failed
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.