airbrake

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

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

Go to latest
Published: Oct 5, 2015 License: MIT Imports: 14 Imported by: 1,399

README

Config
======

set airbrake.Endpoint and airbrake.ApiKey globals

Methods
=======

airbrake.Error(err) reports an error

airbrake.RequestError(err, *http.Request) can be used to add more context if you are in a http context


You can also automatically have this library report panics, use this method:

airbrake.CapturePanic(*http.Request)


example:

  func serve(w http.ResponseWriter, r *http.Request) {
      defer airbrake.CapturePanic(r)
      
      [...]

      panic("Oh no :-(") // will be recorded by airbrake 

  }

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiKey      = ""
	Endpoint    = "https://api.airbrake.io/notifier_api/v2/notices"
	Environment = "development"
	Verbose     = false

	// PrettyParams allows including request query/form parameters on the Environment tab
	// which is more readable than the raw text of the Parameters tab (in Errbit).
	// The param keys will be rendered as "?<param>" so they will sort together at the top of the tab.
	PrettyParams = false
)

Functions

func CapturePanic

func CapturePanic(r *http.Request)

func CapturePanicHandler

func CapturePanicHandler(app http.HandlerFunc) http.HandlerFunc

CapturePanicHandler "middleware". Wraps the http handler so that all panics will be dutifully reported to airbrake

Example:

http.HandleFunc("/", airbrake.CapturePanicHandler(MyServerFunc))

func Error

func Error(e error, request *http.Request) error

func Notify

func Notify(e error) error

Types

type Line

type Line struct {
	Function string
	File     string
	Line     int
}

Jump to

Keyboard shortcuts

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