Documentation ¶
Overview ¶
Package ravenchi implement a middleware for report panic to sentry.io. It also integrate with chi middleware ecosystem by logging any appropriate informations
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SentryRecovery ¶
SentryRecovery recover from panic, report the error back to sentry, log it, and return an internal server error back to the user.
Example ¶
package main import ( "net/http" "github.com/go-chi/chi" "github.com/loikg/ravenchi" ) func main() { r := chi.NewRouter() // Apply the middleware to the router r.Use(ravenchi.SentryRecovery) r.Get("/", func(w http.ResponseWriter, r *http.Request) { panic("catched") }) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.