exception/README.md
2025-08-07 14:47:32 +02:00

27 lines
469 B
Markdown

# Exception
A little Wrapper around the Go Error th handle inner Errors.
## Usage
```Go
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())
}
```