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 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.

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
⌂ 换网址