Discover Packages
github.com/0chain/gosdk
core
common
errors
package
Version:
v1.2.85
Opens a new window with list of versions in this module.
Published: Sep 1, 2021
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Top since errors can be wrapped and stacked,
it's necessary to get the top level error for tests and validations
func Wrap(previous error , current interface{}) error
Wrap wrap the previous error with current error/ message
type Error struct {
Code string `json:"code,omitempty"`
Msg string `json:"msg"`
Location string `json:"location"`
}
Error type for a new application error
New - create a new error
two arguments can be passed!
1. code
2. message
if only one argument is passed its considered as message
if two arguments are passed then
first argument is considered for code and
second argument is considered for message
Source Files
¶
Click to show internal directories.
Click to hide internal directories.