Documentation ¶
Overview ¶
This module implements functions which manipulate errors and provide stack trace information.
NOTE: This package intentionally mirrors the standard "errors" module. All dropbox code should use this.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessage ¶
func GetMessage(err interface{}) string
This returns the error string without stack trace information.
Types ¶
type DropboxError ¶
type DropboxError interface { // This returns the error message without the stack trace. GetMessage() string // This returns the wrapped error. This returns nil if this does not wrap // another error. GetInner() error // Implements the built-in error interface. Error() string // Returns stack addresses as a string that can be supplied to // a helper tool to get the actual stack trace. This function doesn't result // in resolving full stack frames thus is a lot more efficient. StackAddrs() string // Returns stack frames. StackFrames() []StackFrame // Returns string representation of stack frames. // Stack frame formatting looks generally something like this: // dropbox/rpc.(*clientV4).Do // /srv/server/go/src/dropbox/rpc/client.go:87 +0xbf9 // dropbox/exclog.Report // /srv/server/go/src/dropbox/exclog/client.go:129 +0x9e5 // main.main // /home/cdo/tmp/report_exception.go:13 +0x84 // It is discouraged to parse stack frames using string parsing since it can change at any time. // Use StackFrames() function instead to get actual stack frame metadata. GetStack() string }
This interface exposes additional information about the error.
func New ¶
func New(msg string) DropboxError
This returns a new baseError initialized with the given message and the current stack trace.
func Newf ¶
func Newf(format string, args ...interface{}) DropboxError
Same as New, but with fmt.Printf-style parameters.
func Wrapf ¶
func Wrapf(err error, format string, args ...interface{}) DropboxError
Same as Wrap, but with fmt.Printf-style parameters.
Click to show internal directories.
Click to hide internal directories.