Skip to content
Middleware to integrate with sentry crash reporting.
Branch: master
Clone or download
Latest commit d4eec0a Mar 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example fix: invalid character in source code (#3) Jun 20, 2017
.gitignore
.travis.yml
LICENSE
README.md add travis. (#4) Jun 20, 2017
go.mod feat: enable go module Dec 27, 2018
go.sum feat: enable go module Dec 27, 2018
recovery.go

README.md

sentry

Build Status Go Report Card GoDoc Join the chat at https://gitter.im/gin-gonic/gin

Middleware to integrate with sentry crash reporting. Middleware version of raven.RecoveryHandler().

Example

See the example

package main

import (
	"github.com/getsentry/raven-go"
	"github.com/gin-contrib/sentry"
	"github.com/gin-gonic/gin"
)

func init() {
	raven.SetDSN("https://<key>:<secret>@app.getsentry.com/<project>")
}

func main() {
	r := gin.Default()
	r.Use(sentry.Recovery(raven.DefaultClient, false))
	// only send crash reporting
	// r.Use(sentry.Recovery(raven.DefaultClient, true))
	r.Run(":8080")
}
You can’t perform that action at this time.