rollbar

package module
v0.0.0-...-65103c1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2015 License: MIT Imports: 6 Imported by: ? 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

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.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recovery

func Recovery(cfg Config) martini.Handler

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.

Types

type Config

type Config struct {
	Token string
}

Jump to

Keyboard shortcuts

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