errors

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 0 Imported by: 9

Documentation

Overview

Package errors defines custom errors which are widely used across Aptomi code base. One example is ErrorWithDetails, which allows to attach debug information to the error in form of multiple objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details map[string]interface{}

Details is a type which defines a map of objects that will be attached to the error

type ErrorWithDetails

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

ErrorWithDetails is a custom error which stores additional information about the context in which an error occurred. It stores the context, i.e. a map of objects (or, details) in addition to the error message itself

func NewErrorWithDetails

func NewErrorWithDetails(message string, details Details) *ErrorWithDetails

NewErrorWithDetails creates a new ErrorWithDetails

func (*ErrorWithDetails) Details

func (err *ErrorWithDetails) Details() Details

Details returns error context, i.e. map of objects which are attached to the error

func (*ErrorWithDetails) Error

func (err *ErrorWithDetails) Error() string

Error returns an error message

Jump to

Keyboard shortcuts

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