Documentation ¶
Index ¶
- type DefaultFormattingStrategy
- func (dEFS *DefaultFormattingStrategy) Error(message string) *XRayError
- func (dEFS *DefaultFormattingStrategy) Errorf(formatString string, args ...interface{}) *XRayError
- func (dEFS *DefaultFormattingStrategy) ExceptionFromError(err error) Exception
- func (dEFS *DefaultFormattingStrategy) Panic(message string) *XRayError
- func (dEFS *DefaultFormattingStrategy) Panicf(formatString string, args ...interface{}) *XRayError
- type Exception
- type FormattingStrategy
- type MultiError
- type Stack
- type StackTracer
- type XRayError
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 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 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.