errors

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRINT = iota
	LOG
	LOG_EXIT
	PANIC
	NOTHING
)

Variables

View Source
var (
	DEFAULT = PANIC
)

Functions

func HandleError

func HandleError(err *error, action ...interface{}) error

ErrorHandler is a function that handles errors to reduce if-else statements in code. It accepts an error pointer and an optional action. The action can be a function that accepts an error, a function that accepts an error pointer, a function that accepts no arguments, or a numeric value.

Parameters:

  • err: *error
  • action: interface{}

Returns:

  • error

Types

This section is empty.

Jump to

Keyboard shortcuts

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