package
module
Version:
v0.0.0-...-df4c031
Opens a new window with list of versions in this module.
Published: Mar 18, 2016
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
negroni-rollbar
A negroni middleware for rollbar
Forked from jfbus/negroni-rollbar simply because I didn't want to have it
configure Rollbar internally.
The middleware forwards all panics to rollbar.com.
import "github.com/traherom/negroni-rollbar"
func main() {
n := negroni.Classic()
n.Use(rollbar.Report())
}
rollbar.Report recovers panics, the default Recovery handler does nothing.
Documentation
¶
Package negroni-rollbar is a middleware for Negroni that reports panics to rollbar.com.
package main
import (
"github.com/codegangsta/negroni"
"github.com/traherom/negroni-rollbar"
)
func main() {
n := negroni.Classic()
n.Use(rollbar.Report(rollbar.Config{Token: ROLLBAR_TOKEN}))
m := pat.New()
m.Get("/panic", func() {
panic("an error occured")
})
n.UseHandler(m)
n.Run()
}
Report returns a middleware that recovers from any panics, sends the error to rollbar and writes a HTTP 500 response.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.