...

Package bugsnaghandler

import "github.com/goph/emperror/handler/bugsnaghandler"
Overview
Index
Examples

Overview ▾

Package bugsnaghandler provides Bugsnag integration.

type Handler

Handler is responsible for sending errors to Bugsnag.

type Handler struct {
    // contains filtered or unexported fields
}

func New

func New(apiKey string) *Handler

New creates a new handler.

Example

Code:

apiKey := "key"

_ = bugsnaghandler.New(apiKey)

func NewFromNotifier

func NewFromNotifier(notifier *bugsnag.Notifier) *Handler

NewFromNotifier creates a new handler from an existing notifier instance.

Example

Code:

apiKey := "key"

_ = bugsnaghandler.NewFromNotifier(bugsnag.New(bugsnag.Configuration{
    APIKey: apiKey,
}))

func (*Handler) Handle

func (h *Handler) Handle(err error)

Handle sends the error to Bugsnag.