errors

package
v2.2.4 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

View Source
const ImageWithoutSignature = 10

Error verifying image due to no signature

View Source
const NoCertificateFoundOnSignature = 13

Error verifying image due to no certificate found on signature

View Source
const NoMatchingSignature = 12

Error verifying image due to no matching signature

View Source
const NonExistentTag = 11

Error verifying image due to non-existent tag

Variables

This section is empty.

Functions

func Error

func Error(cosignError CosignError) error

func GenerateExitCodeDocs

func GenerateExitCodeDocs(dir string) error

GenerateExitCodeDocs will generate documentation for the exit codes that the cosign application will throw. Inspired by elemental-cli who convieniently solved this problem prior: https://github.com/rancher/elemental-cli/blob/main/docs/generate_docs.go there was no need to change (apart from some file paths) due to it giving us exactly what we want without error.

func LookupExitCodeForError added in v2.1.0

func LookupExitCodeForError(err interface{ error }) int

func WrapError

func WrapError(err error) error

WrapError takes an error type and depending on the type of error passed, will access it's error message and errorType (and return the associated exitCode) and wrap them in a generic `CosignError`. If no custom error has been found, then it will still return a `CosignError` with an error message, but the `exitCode` will be `1`.

Types

type CosignError

type CosignError struct {
	Message string
	Code    int
}

func (*CosignError) Error

func (ce *CosignError) Error() string

Error implements error

func (*CosignError) ExitCode

func (ce *CosignError) ExitCode() int

type ErrorCode

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

Jump to

Keyboard shortcuts

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