Documentation ¶
Index ¶
- func ContextTransfer(ctx, targetCtx context.Context) context.Context
- func Handle(ctx context.Context, rp interface{})
- func HandleError(rp interface{}, handlerName string, w http.ResponseWriter, r *http.Request)
- func HandleErrorNoStack(ctx context.Context, err error)
- func HandleRequest(handlerName string, w http.ResponseWriter, r *http.Request)
- func HandleWithCtx(ctx context.Context, handlerName string)
- func Handler() func(http.Handler) http.Handler
- func Hide(ctx context.Context, err, exposedErr error) error
- func New(text string) error
- func WrapWithExtra(err error, extraInfo map[string]interface{}) error
- type PanicWrap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextTransfer ¶ added in v0.1.17
ContextTransfer copies error handling related information from one context to another.
func HandleError ¶
func HandleError(rp interface{}, handlerName string, w http.ResponseWriter, r *http.Request)
HandleError reports the passed error to sentry
func HandleErrorNoStack ¶ added in v0.1.29
func HandleRequest ¶
func HandleRequest(handlerName string, w http.ResponseWriter, r *http.Request)
HandleRequest should be called with defer to recover panics in request handlers
func HandleWithCtx ¶
HandleWithCtx should be called with defer to recover panics in goroutines
func Hide ¶ added in v0.1.56
Hide checks whether the given error err is a context.Canceled or context.DeadlineExceeded error and if so exposes these errors as wrapped errors while maintaining the given err as string. If the optional exposedErr is provided, it is attached as prefix to the returned error. If the given err is not any of the above ones, the given exposedErr (if present) is wrapped as prefix to the returned error.
func WrapWithExtra ¶
WrapWithExtra adds extra data to an error before reporting to Sentry