Discover Packages
github.com/traherom/negroni-rollbar
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 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
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.
Expand ▾
Collapse ▴
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.