fnerrors

package
v0.0.186 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachLocation added in v0.0.83

func AttachLocation(loc Location, err error) error

func BadDataError added in v0.0.83

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

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

func BadInputError

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

A user-provided input does match our expectations (e.g. missing bits, wrong version, etc).

func DependencyFailed

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

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 ExternalError added in v0.0.83

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

Unexpected error produced by a component external to Namespace.

func InternalError

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

Unexpected error.

func InvocationError

func InvocationError(what, 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) (error, bool)

func IsNamespaceError added in v0.0.83

func IsNamespaceError(err error) bool

func NamespaceTooOld added in v0.0.110

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

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

func NamespaceTooRecent added in v0.0.110

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

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. These errors are expected to user errors, i.e. they are expected errors, due to wrong configuration, etc.

func NewWithLocation added in v0.0.83

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

NewWithLocation returns a new error for a format specifier and optionals args with the stack trace at the point of invocation. These errors are expected to user errors, i.e. they are expected errors, due to wrong configuration, etc.

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 WithLogs

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

Types

type ActionError added in v0.0.83

type ActionError struct {
	ActionID    string
	OriginalErr error
	TraceProto  []*protocol.Task
}

Represents an action error alongside the sequence of actions invocations leading to it.

func (*ActionError) Error added in v0.0.83

func (ae *ActionError) Error() string

func (*ActionError) GRPCStatus added in v0.0.83

func (ae *ActionError) GRPCStatus() *status.Status

func (*ActionError) Trace added in v0.0.83

func (ae *ActionError) Trace() []*protocol.Task

func (*ActionError) Unwrap added in v0.0.83

func (ae *ActionError) Unwrap() error

type BaseError added in v0.0.83

type BaseError struct {
	Kind        ErrorKind
	OriginalErr error
	Location    Location
	// contains filtered or unexported fields
}

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

func (*BaseError) Error added in v0.0.83

func (e *BaseError) Error() string

func (*BaseError) IsExpectedError added in v0.0.83

func (e *BaseError) IsExpectedError() (error, bool)

func (*BaseError) StackTrace added in v0.0.83

func (e *BaseError) StackTrace() stacktrace.StackTrace

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

func (*BaseError) Unwrap added in v0.0.83

func (e *BaseError) Unwrap() error

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

func (*CodegenMultiError) IsExpectedError added in v0.0.83

func (c *CodegenMultiError) IsExpectedError() (error, bool)

type DependencyFailedError

type DependencyFailedError struct {
	BaseError
	Name string
	Type string
}

func (*DependencyFailedError) Error

func (d *DependencyFailedError) Error() string

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 ErrorKind added in v0.0.83

type ErrorKind string
const (
	Kind_USER       ErrorKind = "ns.error.user"
	Kind_INTERNAL   ErrorKind = "ns.error.internal"
	Kind_EXTERNAL   ErrorKind = "ns.error.external"
	Kind_INVOCATION ErrorKind = "ns.error.invocation"
	Kind_BADINPUT   ErrorKind = "ns.error.badinput"
	Kind_BADDATA    ErrorKind = "ns.error.baddata"
	Kind_TRANSIENT  ErrorKind = "ns.error.transient"
)

type ExitError

type ExitError interface {
	ExitCode() int
}

type InvocationErr

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

func (*InvocationErr) Error

func (e *InvocationErr) Error() string

type Location

type Location interface {
	ErrorLocation() string
}

type StackTracer

type StackTracer interface {
	StackTrace() stacktrace.StackTrace
}

type UsageErr

type UsageErr struct {
	BaseError
	Why  string
	What string
}

func (*UsageErr) Error

func (e *UsageErr) 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