errs

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: GPL-3.0, LGPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int
	Name    string
	Package string
	// contains filtered or unexported fields
}

Error implements the standard go error interface.

errors.New(code, format, params ...interface{})

Prints as:

[package] description: details

where details is fmt.Sprintf(self.format, self.params...)

func (Error) Error

func (self Error) Error() (message string)

func (*Error) Fatal

func (self *Error) Fatal() (fatal bool)

err.Fatal() is true if err's severity level is 0 or 1 (logger.ErrorLevel or logger.Silence)

func (Error) Log

func (self Error) Log(v glog.Verbose)

type Errors

type Errors struct {
	Errors  map[int]string
	Package string
	Level   func(code int) logger.LogLevel
}

Errors implements an error handler providing standardised errors for a package. Fields:

Errors:
 a map from error codes to description

Package:
 name of the package/component

Level:
 a function mapping error code to logger.LogLevel (severity)
 if not given, errors default to logger.InfoLevel

func (*Errors) New

func (self *Errors) New(code int, format string, params ...interface{}) *Error

Jump to

Keyboard shortcuts

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