errors

package
v0.0.0-...-035f276 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TryParseErrToUnscannedWithReason

func TryParseErrToUnscannedWithReason(err error) (*contracts.UnscannedReason, bool)

TryParseErrToUnscannedWithReason gets an error the container that the error encountered and returns the info and error according to the type of the error. If the error is expected error (e.g. image is not exists while trying to resolve the digest, unauthorized to arg) then this function create new contracts.ContainerVulnerabilityScanInfo that that status is unscanned and add in the additional metadata field the reason for unscanned - for example contracts.ImageDoesNotExistUnscannedReason. If the function doesn't recognize the error, then it returns nil, err

func TryParseStringToUnscannedWithReasonErr

func TryParseStringToUnscannedWithReasonErr(errAsString string) (error, bool)

TryParseStringToUnscannedWithReasonErr gets a string and try to convert it to a known error from contracts.

Types

type ImageIsNotFoundErr

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

ImageIsNotFoundErr is error that returns when crane is not found an image.

func NewImageIsNotFoundErr

func NewImageIsNotFoundErr(imageRef string, err error) *ImageIsNotFoundErr

func (*ImageIsNotFoundErr) Error

func (err *ImageIsNotFoundErr) Error() string

type RegistryIsNotFoundErr

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

RegistryIsNotFoundErr error that returns due to registry is not found.

func NewRegistryIsNotFoundErr

func NewRegistryIsNotFoundErr(registry string, err error) *RegistryIsNotFoundErr

NewRegistryIsNotFoundErr Constructor for RegistryIsNotFoundErr

func (*RegistryIsNotFoundErr) Error

func (err *RegistryIsNotFoundErr) Error() string

type UnauthorizedErr

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

UnauthorizedErr error that returns due to unauthorized from crane.

func NewUnauthorizedErr

func NewUnauthorizedErr(imageRef string, err error) *UnauthorizedErr

NewUnauthorizedErr Constructor for UnauthorizedErr

func (*UnauthorizedErr) Error

func (err *UnauthorizedErr) Error() string

Jump to

Keyboard shortcuts

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