cfnerr

package
v1.0.1-0...-b79cbba Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cfnerr defines a custom error type used by the RPDK Go plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sprint

func Sprint(code, message, extra string, origErr error) string

Sprint returns a string of the formatted error code.

Both extra and origErr are optional. If they are included their lines will be added, but if they are not included their lines will be ignored.

Types

type BatchedErrors

type BatchedErrors interface {
	error

	// Returns all original errors
	OrigErrs() []error
}

BatchedErrors is a batch of errors which also wraps lower level errors with code, message, and original errors. Calling Error() will include all errors that occurred in the batch.

func NewBatchError

func NewBatchError(code string, message string, origErrs []error) BatchedErrors

NewBatchError groups one or more errors together for processing

type Error

type Error interface {
	// inherit the base error interface
	error

	// Returns an error code
	Code() string

	// Returns the error message
	Message() string

	// Returns the original error
	OrigErr() error
}

An Error wraps lower level errors with code, message and an original error. The underlying concrete error type may also satisfy other interfaces which can be to used to obtain more specific information about the error.

Calling Error() or String() will always include the full information about an error based on its underlying type.

func New

func New(code string, message string, origErr error) Error

New base error

Jump to

Keyboard shortcuts

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