exception

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultFormattingStrategy

type DefaultFormattingStrategy struct {
	FrameCount int
}

DefaultFormattingStrategy is the default implementation of the ExceptionFormattingStrategy and has a configurable frame count.

func NewDefaultFormattingStrategy

func NewDefaultFormattingStrategy() (*DefaultFormattingStrategy, error)

NewDefaultFormattingStrategy initializes DefaultFormattingStrategy with default value of frame count.

func NewDefaultFormattingStrategyWithDefinedErrorFrameCount

func NewDefaultFormattingStrategyWithDefinedErrorFrameCount(frameCount int) (*DefaultFormattingStrategy, error)

NewDefaultFormattingStrategyWithDefinedErrorFrameCount initializes DefaultFormattingStrategy with customer defined frame count.

func (*DefaultFormattingStrategy) Error

func (dEFS *DefaultFormattingStrategy) Error(message string) *XRayError

Error returns the value of XRayError by given error message.

func (*DefaultFormattingStrategy) Errorf

func (dEFS *DefaultFormattingStrategy) Errorf(formatString string, args ...interface{}) *XRayError

Errorf formats according to a format specifier and returns value of XRayError.

func (*DefaultFormattingStrategy) ExceptionFromError

func (dEFS *DefaultFormattingStrategy) ExceptionFromError(err error) Exception

ExceptionFromError takes an error and returns value of Exception

func (*DefaultFormattingStrategy) Panic

func (dEFS *DefaultFormattingStrategy) Panic(message string) *XRayError

Panic records error type as panic in segment and returns value of XRayError.

func (*DefaultFormattingStrategy) Panicf

func (dEFS *DefaultFormattingStrategy) Panicf(formatString string, args ...interface{}) *XRayError

Panicf formats according to a format specifier and returns value of XRayError.

type Error

type Error interface {
	// Satisfy the generic error interface.
	error

	// Returns the short phrase depicting the classification of the error.
	Code() string

	// Returns the error details message.
	Message() string

	// Returns the original error if one was set.  Nil is returned if not set.
	OrigErr() error
}

Copied from: https://github.com/aws/aws-sdk-go/blob/v1.55.6/aws/awserr/error.go#L31-L43

type Exception

type Exception struct {
	ID      string  `json:"id,omitempty"`
	Type    string  `json:"type,omitempty"`
	Message string  `json:"message,omitempty"`
	Stack   []Stack `json:"stack,omitempty"`
	Remote  bool    `json:"remote,omitempty"`
}

Exception provides the shape for unmarshalling an exception.

type FormattingStrategy

type FormattingStrategy interface {
	Error(message string) *XRayError
	Errorf(formatString string, args ...interface{}) *XRayError
	Panic(message string) *XRayError
	Panicf(formatString string, args ...interface{}) *XRayError
	ExceptionFromError(err error) Exception
}

FormattingStrategy provides an interface for implementing methods that format errors and exceptions.

type MultiError

type MultiError []error

MultiError is a type for a slice of error.

func (MultiError) Error

func (e MultiError) Error() string

Error returns a string format of concatenating multiple errors.

type RequestFailure

type RequestFailure interface {
	Error

	// The status code of the HTTP response.
	StatusCode() int

	// The request ID returned by the service for a request failure. This will
	// be empty if no request ID is available such as the request failed due
	// to a connection error.
	RequestID() string
}

Copied from: https://github.com/aws/aws-sdk-go/blob/v1.55.6/aws/awserr/error.go#L129-L139

type Stack

type Stack struct {
	Path  string `json:"path,omitempty"`
	Line  int    `json:"line,omitempty"`
	Label string `json:"label,omitempty"`
}

Stack provides the shape for unmarshalling an stack.

type StackTracer

type StackTracer interface {
	StackTrace() []uintptr
}

StackTracer is an interface for implementing StackTrace method.

type XRayError

type XRayError struct {
	Type    string
	Message string
	Stack   []uintptr
}

XRayError records error type, message, and a slice of stack frame pointers.

func (*XRayError) Error

func (e *XRayError) Error() string

Error returns the value of error message.

func (*XRayError) StackTrace

func (e *XRayError) StackTrace() []uintptr

StackTrace returns a slice of integer pointers.

Jump to

Keyboard shortcuts

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