Documentation
¶
Overview ¶
Package errors implements for error handling simple and useful
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(err error) (Fundamental, Code)
Parse returns fundamental error and code from all of error types
Types ¶
type Code ¶
type Code uint
Code implements error code number, you can extends this with define constants with this type
const ( // CodeNil means no error exists CodeNil Code = iota // CodeUnimplemented means code does not implemented CodeUnimplemented // CodeUnknown means unknown error raised CodeUnknown // CodeInternal means internal module returns error CodeInternal // CodeUnauthenticated means user does not authenticated CodeUnauthenticated // CodePermissionDenied means user does not have access permissions CodePermissionDenied // CodeInvalidData means input parameters are invalid CodeInvalidData // CodeNotFound means there is no data found CodeNotFound // CodeAlreadyExists means there is same data is already exists CodeAlreadyExists )
type Fundamental ¶
type Fundamental interface { error // Code returns error code Code() Code // Message returns error message Message() string // Stacktrace returns error stacktrace StackTrace() stacktrace.Stacktrace }
Fundamental interface of fundamental error
func Cast ¶ added in v1.2.1
func Cast(err error, code Code) Fundamental
Cast returns new instance fundamental error with error cause and code
func New ¶
func New(code Code, message string, args ...interface{}) Fundamental
New returns new instance fundamental error with args
Directories
¶
Path | Synopsis |
---|---|
Package stacktrace is implements for capture errors stacktrace
|
Package stacktrace is implements for capture errors stacktrace |
Click to show internal directories.
Click to hide internal directories.