errors

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package errors defines all errors returned to users by Scorecard library.

Index

Constants

View Source
const (
	// RetryError occurs when checks fail after exhausting all retry attempts.
	RetryError = "RetryError"
	// LowConfidenceError shows a low-confidence result.
	LowConfidenceError = "LowConfidenceError"
	// UnknownError for all error types not handled.
	UnknownError = "UnknownError"
)

Variables

View Source
var (
	ErrScorecardInternal = errors.New("internal error")
	ErrRepoUnreachable   = errors.New("repo unreachable")
)

UPGRADEv2: delete other files in folder. nolint

Functions

func Create

func Create(e error, msg string) error

Create a public error using any of the errors listed above. For examples, see errors/errors.md.

func CreateInternal added in v2.1.3

func CreateInternal(e error, msg string) error

CreateInternal creates an internal error, not using any of the errors listed above.

func GetErrorName

func GetErrorName(err error) string

GetErrorName returns the name of the error.

func MakeLowConfidenceError

func MakeLowConfidenceError(err error) error

MakeLowConfidenceError returns a wrapped error of type ErrLowConfidence.

func MakeRetryError

func MakeRetryError(err error) error

MakeRetryError returns a wrapped error of type ErrRetry.

Types

type ErrLowConfidence

type ErrLowConfidence struct {
	// contains filtered or unexported fields
}

ErrLowConfidence is returned when check result is inconclusive.

func (*ErrLowConfidence) Error

func (err *ErrLowConfidence) Error() string

func (*ErrLowConfidence) Unwrap

func (err *ErrLowConfidence) Unwrap() error

type ErrRetry

type ErrRetry struct {
	// contains filtered or unexported fields
}

ErrRetry is returned when a check failed after maximum num_retries.

func (*ErrRetry) Error

func (err *ErrRetry) Error() string

func (*ErrRetry) Unwrap

func (err *ErrRetry) Unwrap() error

Jump to

Keyboard shortcuts

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