bugsnag

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bugsnag provides Bugsnag integration.

Bugsnag recommends to create a global scope error handler. Although that works, makes writting software harder, so this package recommends creating a separate instance:

APIKey := "key"

handler := bugsnag.NewHandler(APIKey)

If you need access to the underlying Notifier instance (or need more advanced construction), you can access it from the handler:

handler.Notifier.Config.AppVersion = "1.0.0"

Bugsnag provides an extensive set of configuration options, so it might make sense to manually construct it:

// Note: there is a conflict in package names which we resolved with the "_" (underline) prefix.
handler := &_bugsnag.Handler {
	Notifier: bugsnag.New(bugsnag.Configuration{
		APIKey:      APIKey,
		Synchronous: true,
	})
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Notifier *bugsnag.Notifier
}

Handler is responsible for sending errors to Bugsnag.

func NewHandler

func NewHandler(APIKey string) *Handler

NewHandler creates a new Bugsnag handler.

func (*Handler) Handle

func (h *Handler) Handle(err error)

Handle calls the underlying Airbrake notifier.

Jump to

Keyboard shortcuts

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