errors

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DriverGoErrorPrefix = "driver-go"

Variables

This section is empty.

Functions

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf returns an error with driver-go's error prefix

func ErrorfWithCaller

func ErrorfWithCaller(format string, a ...interface{}) error

ErrorfWithCaller returns a formatted error with the caller function as prefix e.g. driver-go(callerFunctionName): format To prevent the error from chaining and becoming too long: If format starts with "driver-go: ", remove "driver-go: " prefix from format If format starts with "driver-go(someFuncName):", remove "driver-go" prefix from format

func GetCallerFunctionName

func GetCallerFunctionName(skip int) string

GetCallerFunctionName gets the name of the calling function skip is the number of levels up from this function e.g. GetCallerFunctionName is called in main.Test() which in called in main.Main if skip == 1 -> main.Test is returned if skip == 2 -> main.Main is returned

func GetFunctionName

func GetFunctionName(i interface{}) string

GetFunctionName returns the name of the function `i`. Should be passed a function value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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