rollbar

package module
v0.0.0-...-df4c031 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2016 License: MIT Imports: 5 Imported by: 0

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

Overview

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()
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReport

func NewReport() negroni.Handler

Report returns a middleware that recovers from any panics, sends the error to rollbar and writes a HTTP 500 response.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL