Back to / log / errorreporter

Package errorreporter

Latest Go to latest

The latest major version is .

Published: Jul 31, 2020 | License: BSD-3-Clause | Module:


Package errorreporter provides error reporting functionality.


func Do

func Do(req *http.Request, err *error)

Do will be used as defer func to recover panic and report error if panic detected. Also update err if err != nil.

func Enabled

func Enabled() bool

Enabled reports DefaultErrorReporter is configured to report crash to stackdriver.

func Flush

func Flush()

Flush flushes DefaultErrorReporter.

func Report

func Report(e errorreporting.Entry)

Report reports entry with DefaultErrorReporter.

func ReportSync

func ReportSync(ctx context.Context, e errorreporting.Entry) error

ReportSync reports entry with DefaultErrorReporter.

type ErrorReporter

type ErrorReporter interface {
	Close() error
	Report(e errorreporting.Entry)
	ReportSync(ctx context.Context, e errorreporting.Entry) error

ErrorReporter is an interface to report crash to stackdriver error reporting.

var DefaultErrorReporter ErrorReporter = nopErrorReporter{}

func New

func New(ctx context.Context, projectID, serviceName string) ErrorReporter

New creates error reporter.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier