Documentation
¶
Index ¶
- func AttachLocation(loc Location, err error) error
- func BadDataError(format string, args ...interface{}) error
- func BadInputError(format string, args ...interface{}) error
- func DependencyFailed(name, typ string, err error) error
- func DoesNotMeetVersionRequirements(what string, expected, got int32) error
- func ExitWithCode(err error, code int) error
- func ExternalError(format string, args ...interface{}) error
- func InternalError(format string, args ...interface{}) error
- func InvocationError(what, format string, args ...interface{}) error
- func IsDependencyFailed(err error) bool
- func IsExpected(err error) (error, bool)
- func IsNamespaceError(err error) bool
- func New(format string, args ...interface{}) error
- func NewWithLocation(loc Location, format string, args ...interface{}) error
- func NoAccessToLimitedFeature() error
- func TransientError(format string, args ...interface{}) error
- func UsageError(runThis, toFixThis string, args ...interface{}) error
- func WithLogs(err error, readerF func() io.Reader) error
- type ActionError
- type BaseError
- type CodegenError
- type CodegenMultiError
- type DependencyFailedError
- type ErrWithLogs
- type ErrorCollector
- type ErrorKind
- type ExitError
- type InvocationErr
- type Location
- type StackTracer
- type UsageErr
- type VersionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachLocation ¶ added in v0.0.83
func BadDataError ¶ added in v0.0.83
The data does match our expectations (e.g. missing bits, wrong version, etc).
func BadInputError ¶
A user-provided input does match our expectations (e.g. missing bits, wrong version, etc).
func DependencyFailed ¶
func DoesNotMeetVersionRequirements ¶
This error means that Namespace does not meet the minimum version requirements.
func ExitWithCode ¶
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
Unexpected error produced by a component external to Namespace.
func InvocationError ¶
A call to a remote endpoint failed, perhaps due to a transient issue.
func IsDependencyFailed ¶
func IsExpected ¶
func IsNamespaceError ¶ added in v0.0.83
func New ¶
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
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 ¶
We failed but it may be due a transient issue.
func UsageError ¶
Configuration or system setup is not correct and requires user intervention.
Types ¶
type ActionError ¶ added in v0.0.83
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) IsExpectedError ¶ added in v0.0.83
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.
type CodegenError ¶
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 ¶
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 InvocationErr ¶
type InvocationErr struct { BaseError // contains filtered or unexported fields }
func (*InvocationErr) Error ¶
func (e *InvocationErr) Error() string
type StackTracer ¶
type StackTracer interface {
StackTrace() stacktrace.StackTrace
}
type VersionError ¶
func (*VersionError) Error ¶
func (e *VersionError) Error() string
Directories
¶
Path | Synopsis |
---|---|
Pretty-printing of various namespace errors.
|
Pretty-printing of various namespace errors. |