469 B
469 B
Exception
A little Wrapper around the Go Error th handle inner Errors.
Usage
package main
import "fmt"
const (
InvalidArgumentException = exception.NewCustom("InvalidArgument")
)
func main() {
// a Error occurs
nilErr := fmt.Errorf("argument can not be nil")
// use Error in Exception
InvalidArgumentException.With(nilErr)
// print out:
// [InvalidArgument]:
// argument can not be nil
println(InvalidArgumentException.Error())
}