errorutils

package
v0.0.0-...-46da95b Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkingDirectoryKey = "current-working-directory"
)

Variables

This section is empty.

Functions

func DecorateTestError

func DecorateTestError(err error, config configuration.Configuration) error

DecorateTestError adds working directory metadata to all Snyk errors in the error chain

func GetWorkingDirectory

func GetWorkingDirectory(err *snyk_errors.Error) ([]string, bool)

func ProcessSnykErrorsInChain

func ProcessSnykErrorsInChain(err error, processor SnykErrorProcessor) error

ProcessSnykErrorsInChain iterates through an error chain and applies the processor function to each Snyk error found, while preserving the error chain structure.

func WithWorkingDirectory

func WithWorkingDirectory(directories []string) snyk_errors.Option

WithWorkingDirectory creates an option that adds given working directory to the error

Types

type SnykErrorProcessor

type SnykErrorProcessor func(*snyk_errors.Error)

SnykErrorProcessor is a function type that processes a Snyk error

Jump to

Keyboard shortcuts

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