Documentation
¶
Overview ¶
Package err implements a Golang error data type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents a Golang error which has a "class" as well as a "type". The class and type attributes of this data type, are meant to help facilitate error handling in a Golang software.
func New ¶
New () creates a new data of this type. Always use this function, when you want to create new errors.
Input 0: The error -- a string describing it.
Input 1: The error's class.
Input 2: The error's type. This could be used to further identify errors falling under a common class.
Input 3: If the error you are creating is caused by another error, this value could be that error which caused the error you are creating. For example, if you want to create error A (File could not be opened). And error A was caued by error B (File does not exist). Then the value of this input could be error B. If error A is not caused by any error, you should skip this input.
someErr := err.New ("File could not be opened", big.NewInt (36), big.NewInt (8),
errors.New ("File does not exist"))