wapp

package
v1.37.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithFatalLogging

func RunWithFatalLogging(ctx context.Context, runFn func(ctx context.Context) error) (retErr error)

RunWithFatalLogging wraps a callback, logging errors and panics it returns. Useful as a "catch all" for applications so that they can log fatal events, perhaps before exiting.

func RunWithRecoveryLogging added in v1.3.5

func RunWithRecoveryLogging(ctx context.Context, runFn func(ctx context.Context))

RunWithRecoveryLogging wraps a callback, logging any panics recovered as errors. Useful as a "catch all" for applications so that they can log fatal events, perhaps before exiting.

func RunWithRecoveryLoggingWithError added in v1.9.0

func RunWithRecoveryLoggingWithError(ctx context.Context, runFn func(ctx context.Context) error) (retErr error)

RunWithRecoveryLoggingWithError is identical to RunWithFatalLogging however it only emits logs on panics, not if runFn a normal error This can be useful if you want to special case the logging of this error but still want a centralized place to handle panics

Types

This section is empty.

Jump to

Keyboard shortcuts

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