exception

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 5 Imported by: 1

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Custom

type Custom interface {
	error
	At(source any) Custom
	With(innerErr ...error) Custom
	IsSameAs(err error) bool
}

func NewCustom

func NewCustom(message string, innerErr ...error) Custom

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL