conerror

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

README

conerror

import "github.com/jlaswell/conerror"

Overview

Package conerror provides contextual errors.

Index

Package files

error.go

type ConError

type ConError interface {
    error

    // Get contextual information.
    Get(key interface{}) interface{}
    // Set contextual information.
    Set(key, val interface{})
}

ConError is a contextual error. It can be used as a std error and to hold extra information via the Get() and Set() methods available.

func New
func New(text string) ConError

New create a new ConError from an error message.

func NewFromError
func NewFromError(err error) ConError

NewFromError creates a new ConError from an error.

type Error

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

Error provides an implementation of the ConError interface.

func (*Error) Error
func (e *Error) Error() string

Error returns the message for this error.

func (*Error) Get
func (e *Error) Get(key interface{}) interface{}

Get contextual information.

func (*Error) Set
func (e *Error) Set(key, val interface{})

Set contextual information.


Generated by godoc2md

Documentation

Overview

Package conerror provides contextual errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConError

type ConError interface {
	error

	// Get contextual information.
	Get(key interface{}) interface{}
	// Set contextual information.
	Set(key, val interface{})
}

ConError is a contextual error. It can be used as a std error and to hold extra information via the Get() and Set() methods available.

func New

func New(text string) ConError

New create a new ConError from an error message.

func NewFromError

func NewFromError(err error) ConError

NewFromError creates a new ConError from an error.

type Error

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

Error provides an implementation of the ConError interface.

func (*Error) Error

func (e *Error) Error() string

Error returns the message for this error.

func (*Error) Get

func (e *Error) Get(key interface{}) interface{}

Get contextual information.

func (*Error) Set

func (e *Error) Set(key, val interface{})

Set contextual information.

Jump to

Keyboard shortcuts

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