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

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())
}