Documentation
¶
Overview ¶
Package scout implement a middleware for report panic to sentry.io.
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/zy4/scout"
)
func main() {
r := chi.NewRouter()
// Apply the middleware to the router
r.Use(scout.SentryRecovery)
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
panic("caught")
})
}
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.