Discover Packages
github.com/jfbus/martini-rollbar
package
module
Version:
v0.0.0-...-65103c1
Opens a new window with list of versions in this module.
Published: Feb 25, 2015
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
martini-rollbar
A martini middleware for rollbar
The middleware :
forwards all panics to rollbar.com,
only triggers in the production environment.
import "github.com/jfbus/martini-rollbar"
func main() {
m := martini.Classic()
m.Use(rollbar.Recovery(rollbar.Config{Token: "YOUR SERVER TOKEN"}))
}
rollbar.Recover recovers panics, the default Recovery handler does nothing.
Expand ▾
Collapse ▴
Documentation
¶
Package martini-rollbar is a middleware for Martini that reports panics to rollbar.com.
package main
import (
"github.com/go-martini/martini"
"github.com/jfbus/martini-rollbar"
)
func main() {
m := martini.Classic()
m.Use(rollbar.Report(rollbar.Config{Token: ROLLBAR_TOKEN}))
m.Get("/panic", func() {
panic("an error occured")
})
m.Run()
}
Recovery returns a middleware that recovers from any panics, sends the error to rollbar and writes a HTTP 500 response.
It only triggers in production environments.
type Config struct {
Token string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.