telemetry

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorReportingHandler

func NewErrorReportingHandler(errorReturningHandler ErrorReturningHTTPHandler) http.Handler

NewErrorReportingHandler wraps an ErrorReturningHTTPHandler with error reporting

func ReportError

func ReportError(ctx context.Context, err error)

ReportError reports an error to Sentry

func SetupErrorReporting

func SetupErrorReporting(sentryDSN, environment string)

SetupErrorReporting configures the Sentry SDK for error reporting

Types

type ErrorReturningHTTPHandler

type ErrorReturningHTTPHandler func(http.ResponseWriter, *http.Request) error

ErrorReturningHTTPHandler is a HTTP handler function that returns an error

type HTTPError

type HTTPError struct {
	// contains filtered or unexported fields
}

HTTPError is an error that also has an associated HTTP status code

func NewHTTPError

func NewHTTPError(err error, statusCode int) HTTPError

NewHTTPError creates a new HTTPError

func (HTTPError) Error

func (he HTTPError) Error() string

Error implements the error interface

func (HTTPError) StatusCode

func (he HTTPError) StatusCode() int

StatusCode returns the HTTP status code associated with the error

Jump to

Keyboard shortcuts

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