Categorygithub.com/tethik/sentrymiddleware
modulepackage
0.0.0-20180610231403-bfb8cd03e9d8
Repository: https://github.com/tethik/sentrymiddleware.git
Documentation: pkg.go.dev

# README

echo-sentry-middleware

Another Sentry middleware for the Echo framework

Usage


func main() {
    // Echo instance
	e := echo.New()
	dsn, found := os.LookupEnv("SENTRY_RAVEN_DSN")
	if found {
		raven.SetDSN(dsn)
		e.Use(sentrymiddleware.SentryErrorRecover())
    }    
	// Start server
	e.Logger.Fatal(e.Start(":1323"))
}

Todo

  1. Set DSN via this package (and use own client)
  2. Tests
  3. Better example.
  4. Versioning.

# Functions

SentryErrorRecover captures the error to forward to sentry then passed the error up to the next recover error handler.