errutil

package
v0.0.0-...-5f60744 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(msg string)

Fail logs the given messages and terminates the application

func FailOn

func FailOn(err error)

FailOn logs the error information (terminates the application)

func FailOnWithInfo

func FailOnWithInfo(err error, info map[string]string)

FailOnWithInfo logs the error information with additional context info (terminates the application)

func FailWhen

func FailWhen(cond bool, msg string)

FailWhen logs the given message if the condition is true (terminates the application)

func IsNoChildProcesses

func IsNoChildProcesses(err error) bool

exec.Command().Run() and its derivatives sometimes return "wait: no child processes" or "waitid: no child processes" even for successful runs. It's a race condition between the Start() + Wait() calls and the actual underlying command execution. The shorter the execution time, the higher are the chances to get this error.

Some examples from the wild:

func WarnOn

func WarnOn(err error)

WarnOn logs the error information as a warning

Types

This section is empty.

Jump to

Keyboard shortcuts

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