issuelink

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const UnimplementedErrorHint = `You have attempted to use a feature that is not yet implemented.`

UnimplementedErrorHint is the hint emitted upon unimplemented errors.

Variables

This section is empty.

Functions

func HasIssueLink(err error) bool

HasIssueLink returns true iff the error or one of its causes has a linked issue payload.

func HasUnimplementedError

func HasUnimplementedError(err error) bool

HasUnimplementedError returns iff if err or its cause is an unimplemented error.

func IsIssueLink(err error) bool

IsIssueLink returns true iff the error (not its causes) has a linked issue payload.

func IsUnimplementedError

func IsUnimplementedError(err error) bool

IsUnimplementedError returns iff if err is an unimplemented error.

func UnimplementedError

func UnimplementedError(issueLink IssueLink, msg string) error

UnimplementedError creates a new leaf error that indicates that some feature was not (yet) implemented.

Detail is shown: - via `errors.GetSafeDetails()` - when formatting with `%+v`. - in Sentry reports. - via `errors.GetAllHints()` / `errors.FlattenHints()`

func UnimplementedErrorf

func UnimplementedErrorf(issueLink IssueLink, format string, args ...interface{}) error

UnimplementedErrorf creates a new leaf error that indicates that some feature was not (yet) implemented. The message is formatted.

func WithIssueLink(err error, issue IssueLink) error

WithIssueLink adds an annotation to a know issue on a web issue tracker.

The url and detail strings may contain PII and will be considered reportable.

Detail is shown: - via `errors.GetSafeDetails()` - when formatting with `%+v`. - in Sentry reports. - via `errors.GetAllHints()` / `errors.FlattenHints()`

Types

type IssueLink struct {
	// URL to the issue on a tracker.
	IssueURL string
	// Annotation that characterizes a sub-issue.
	Detail string
}

IssueLink is the payload for a linked issue annotation.

func GetAllIssueLinks(err error) (issues []IssueLink)

GetAllIssueLinks retrieves the linked issue carried by the error or its direct causes.

func GetIssueLink(err error) (IssueLink, bool)

GetIssueLink retrieves the linked issue annotation carried by the error, or false if there is no such annotation.

Jump to

Keyboard shortcuts

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