errors

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 392

Documentation

Index

Constants

View Source
const (
	InspectImageError int = 1 + iota
	PullImageError
	SaveArtifactsError
	AssembleError
	WorkdirError
	BuildError
	TarTimeoutError
	DownloadError
	ScriptsInsideImageError
	InstallError
	InstallErrorRequired
	URLHandlerError
	STIContainerError
	SourcePathError
	UserNotAllowedError
	EmptyGitRepositoryError
)

Common S2I errors

Variables

This section is empty.

Functions

func CheckError added in v1.1.4

func CheckError(err error)

CheckError checks input error. 1. if the input error is nil, the function does nothing but return. 2. if the input error is a kind of Error which is thrown during S2I execution, the function handle it with Suggestion and Details. 3. if the input error is a kind of system Error which is unknown, the function exit with 1.

func NewAssembleError

func NewAssembleError(name, output string, err error) error

NewAssembleError returns a new error which indicates there was a problem running assemble script

func NewAssembleUserNotAllowedError added in v1.1.12

func NewAssembleUserNotAllowedError(image string, usesConfig bool) error

NewAssembleUserNotAllowedError returns a new error that indicates that the build could not run because the build or image uses an assemble user outside of the range of allowed users.

func NewBuildError

func NewBuildError(name string, err error) error

NewBuildError returns a new error which indicates there was a problem building the image

func NewCommitError added in v1.0.8

func NewCommitError(name string, err error) error

NewCommitError returns a new error which indicates there was a problem committing the image

func NewContainerError

func NewContainerError(name string, code int, output string) error

NewContainerError return a new error which indicates there was a problem invoking command inside container

func NewDownloadError

func NewDownloadError(url string, code int) error

NewDownloadError returns a new error which indicates there was a problem when downloading a file

func NewEmptyGitRepositoryError added in v1.1.2

func NewEmptyGitRepositoryError(source string) error

NewEmptyGitRepositoryError returns a new error which indicates that a found .git directory has no tracking information, e.g. if the user simply used `git init` and forgot about the repository

func NewInspectImageError

func NewInspectImageError(name string, err error) error

NewInspectImageError returns a new error which indicates there was a problem inspecting the image

func NewInstallError

func NewInstallError(script string) error

NewInstallError returns a new error which indicates there was a problem when downloading a script

func NewInstallRequiredError

func NewInstallRequiredError(scripts []string, label string) error

NewInstallRequiredError returns a new error which indicates there was a problem when downloading a required script

func NewPullImageError

func NewPullImageError(name string, err error) error

NewPullImageError returns a new error which indicates there was a problem pulling the image

func NewSaveArtifactsError

func NewSaveArtifactsError(name, output string, err error) error

NewSaveArtifactsError returns a new error which indicates there was a problem calling save-artifacts script

func NewScriptsInsideImageError

func NewScriptsInsideImageError(url string) error

NewScriptsInsideImageError returns a new error which informs of scripts being placed inside the image

func NewSourcePathError added in v1.0.1

func NewSourcePathError(path string) error

NewSourcePathError returns a new error which indicates there was a problem when accessing the source code from the local filesystem

func NewTarTimeoutError

func NewTarTimeoutError() error

NewTarTimeoutError returns a new error which indicates there was a problem when sending or receiving tar stream

func NewURLHandlerError

func NewURLHandlerError(url string) error

NewURLHandlerError returns a new error which indicates there was a problem when trying to read scripts URL

func NewUserNotAllowedError added in v1.1.0

func NewUserNotAllowedError(image string, onbuild bool) error

NewUserNotAllowedError returns a new error that indicates that the build could not run because the image uses a user outside of the range of allowed users

func NewWorkDirError

func NewWorkDirError(dir string, err error) error

NewWorkDirError returns a new error which indicates there was a problem when creating working directory

func UsageError added in v1.1.4

func UsageError(msg string) error

UsageError checks command usage error.

Types

type ContainerError

type ContainerError struct {
	Message    string
	Output     string
	ErrorCode  int
	Suggestion string
	ExitCode   int
}

ContainerError is an error returned when a container exits with a non-zero code. ExitCode contains the exit code from the container

func (ContainerError) Error

func (s ContainerError) Error() string

Error returns a string for the given error

type Error

type Error struct {
	Message    string
	Details    error
	ErrorCode  int
	Suggestion string
}

Error represents an error thrown during S2I execution

func (Error) Error

func (s Error) Error() string

Error returns a string for a given error

Jump to

Keyboard shortcuts

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