errors

package
Version: v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: GPL-3.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectMessages

func InjectMessages(m Messages)

InjectMessages injects errors messages into a global message map. Any package with own errors defined should call this function during its initialisation (i.e. in init() function).

func Message

func Message(e Error) (string, bool)

Message returns an error message from a given error code.

Types

type Error

type Error int

Error is an error code supporting the standard error interface.

func (Error) Code

func (e Error) Code() int

Code returns an error code of a given error.

func (Error) Error

func (e Error) Error() string

Error returns an error message of a given error.

type Messages

type Messages map[Error]string

Messages is a mapping between error codes and error messages.

Source Files

Jump to

Keyboard shortcuts

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