fnerrors

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadInputError

func BadInputError(format string, args ...interface{}) error

The input does match our expectations (e.g. missing bits, wrong version, etc).

func DependencyFailed

func DependencyFailed(name, typ string, err error) error

func DoesNotMeetVersionRequirements

func DoesNotMeetVersionRequirements(what string, expected, got int32) error

This error means that Namespace does not meet the minimum version requirements.

func ExitWithCode

func ExitWithCode(err error, code int) error

This error is purely for wiring and ensures that Namespace exits with an appropriate exit code. The error content has to be output independently.

func ExpectedError

func ExpectedError(format string, args ...interface{}) error

This error is expected, e.g. a rebuild is required.

func InternalError

func InternalError(format string, args ...interface{}) error

Unexpected situation.

func InvocationError

func InvocationError(format string, args ...interface{}) error

A call to a remote endpoint failed, perhaps due to a transient issue.

func IsDependencyFailed

func IsDependencyFailed(err error) bool

func IsExpected

func IsExpected(err error) (string, bool)

func New

func New(format string, args ...interface{}) error

New returns a new error for a format specifier and optionals args with the stack trace at the point of invocation.

func NoAccessToLimitedFeature

func NoAccessToLimitedFeature() error

func TransientError

func TransientError(format string, args ...interface{}) error

We failed but it may be due a transient issue.

func UsageError

func UsageError(runThis, toFixThis string, args ...interface{}) error

Configuration or system setup is not correct and requires user intervention.

func UserError

func UserError(loc Location, format string, args ...interface{}) error

func WithLogs

func WithLogs(err error, readerF func() io.Reader) error

func Wrap

func Wrap(loc Location, err error) error

func Wrapf

func Wrapf(loc Location, err error, whatFmt string, args ...interface{}) error

Types

type CodegenError

type CodegenError struct {
	PackageName string
	What        string
	Err         error
}

CodegenError associates an error with a code generation phase and package.

func (*CodegenError) Error

func (c *CodegenError) Error() string

func (*CodegenError) Unwrap

func (c *CodegenError) Unwrap() error

type CodegenMultiError

type CodegenMultiError struct {
	// accumulated CodenErrors.
	Errs []CodegenError

	// aggregates CodegenErrors by root error message.
	CommonErrs map[string]map[string]packages

	// contains errors not grouped in [commonerrs].
	UniqGenErrs []CodegenError
}

CodegenMultiError accumulates multiple CodegenError(s).

func (*CodegenMultiError) Error

func (c *CodegenMultiError) Error() string

type DependencyFailedError

type DependencyFailedError struct {
	NsError
	Name string
	Type string
}

func (*DependencyFailedError) Error

func (d *DependencyFailedError) Error() string

func (*DependencyFailedError) Unwrap

func (d *DependencyFailedError) Unwrap() error

type ErrWithLogs

type ErrWithLogs struct {
	Err     error
	ReaderF func() io.Reader // Returns reader with command's stderr output.
}

func (*ErrWithLogs) Error

func (e *ErrWithLogs) Error() string

type ErrorCollector

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

A thread-safe container for CodegenError that can generate a CodegenMultiError.

func (*ErrorCollector) Append

func (c *ErrorCollector) Append(generr CodegenError)

func (*ErrorCollector) Error

func (c *ErrorCollector) Error() error

Error returns a CodegenMultiError which aggregates all errors that were gathered. If no errors were collected, this method returns nil.

type ExitError

type ExitError interface {
	ExitCode() int
}

type InternalErr

type InternalErr struct {
	NsError
	// contains filtered or unexported fields
}

func (*InternalErr) Error

func (e *InternalErr) Error() string

type InvocationErr

type InvocationErr struct {
	NsError
	// contains filtered or unexported fields
}

func (*InvocationErr) Error

func (e *InvocationErr) Error() string

type Location

type Location interface {
	ErrorLocation() string
}

type NsError

type NsError struct {
	Err error
	// contains filtered or unexported fields
}

Wraps an error with a stack trace at the point of invocation.

func (*NsError) Error

func (f *NsError) Error() string

func (*NsError) StackTrace

func (f *NsError) StackTrace() stacktrace.StackTrace

Signature is compatible with pkg/errors and allows frameworks like Sentry to automatically extract the frame.

func (*NsError) Unwrap

func (f *NsError) Unwrap() error

type StackTracer

type StackTracer interface {
	StackTrace() stacktrace.StackTrace
}

type UsageErr

type UsageErr struct {
	NsError
	Why  string
	What string
}

func (*UsageErr) Error

func (e *UsageErr) Error() string

type UserErr

type UserErr struct {
	NsError
	Location Location
}

func (*UserErr) Error

func (e *UserErr) Error() string

type VersionError

type VersionError struct {
	What          string
	Expected, Got int32
}

func (*VersionError) Error

func (e *VersionError) Error() string

Directories

Path Synopsis
Pretty-printing of various namespace errors.
Pretty-printing of various namespace errors.

Jump to

Keyboard shortcuts

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