Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is responsible for sending errors to Sentry.
func New ¶
New creates a new handler.
Example ¶
package main
import (
sentryhandler "emperror.dev/handler/sentry"
)
func main() {
dsn := "https://user:password@sentry.io/1234"
handler, err := sentryhandler.New(dsn)
if err != nil {
panic(err)
}
defer handler.Close() // Make sure to close the handler to flush all error reporting in progress
}
func NewFromClient ¶
NewFromClient creates a new handler from a client instance.
Example ¶
dsn := "https://user:password@sentry.io/1234"
client, err := raven.New(dsn)
if err != nil {
panic(err)
}
handler := sentryhandler.NewFromClient(client)
defer handler.Close() // Make sure to close the handler to flush all error reporting in progress
func NewSync ¶
NewSync creates a new handler that sends errors synchronously.
Example ¶
package main
import (
sentryhandler "emperror.dev/handler/sentry"
)
func main() {
dsn := "https://user:password@sentry.io/1234"
handler, err := sentryhandler.NewSync(dsn)
if err != nil {
panic(err)
}
defer handler.Close()
}
func NewSyncFromClient ¶
NewSyncFromClient creates a new handler from a client instance that sends errors synchronously.
Example ¶
dsn := "https://user:password@sentry.io/1234"
client, err := raven.New(dsn)
if err != nil {
panic(err)
}
handler := sentryhandler.NewSyncFromClient(client)
defer handler.Close()
Click to show internal directories.
Click to hide internal directories.