errors

package
v0.0.0-...-2ecc584 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCode

type ErrCode uint32

func ErrorCodeForError

func ErrorCodeForError(err error) (ErrCode, string)

errorCodeForError returns the errorCode and a specific error message for given error.

type K6Error

type K6Error struct {
	Code          ErrCode
	Message       string
	OriginalError error
}

K6Error is a helper struct that enhances Go errors with custom k6-specific error-codes and more user-readable error messages.

func NewK6Error

func NewK6Error(code ErrCode, msg string, originalErr error) K6Error

NewK6Error is the constructor for K6Error

func (K6Error) Error

func (k6Err K6Error) Error() string

Error implements the `error` interface, so K6Errors are normal Go errors.

func (K6Error) Unwrap

func (k6Err K6Error) Unwrap() error

Unwrap implements the `xerrors.Wrapper` interface, so K6Errors are a bit future-proof Go 2 errors.

Jump to

Keyboard shortcuts

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