modulepackage
0.0.0-20201030155909-2f5f890dbc62
Repository: https://github.com/spacemonkeygo/errors.git
Documentation: pkg.go.dev
# README
errors 
Please see http://godoc.org/github.com/spacemonkeygo/errors for info
License
Copyright (C) 2014 Space Monkey, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
# Packages
Package errhttp provides some useful helpers on top of the errors package for
HTTP handling.
# Functions
AttachStack adds another stack to the current error's stack trace if it exists.
CaptureStack tells the error class and its descendents to capture the stack whenever an error of this class is created, and output it as part of the error's Error() method.
CatchPanic can be used to catch panics and turn them into errors.
If DisableInheritance is provided, the error or error class will belong to its ancestors, but will not inherit their settings and options.
Finalize takes a group of ErrorGroups and joins them together into one error.
GenSym generates a brand new, never-before-seen DataKey.
GetClass will return the appropriate error class for the given error.
GetData returns the value associated with the given DataKey on this error or any of its ancestors.
GetExits will return the exits recorded on the error if any are found.
GetMessage returns just the error message without the backtrace or exits.
GetStack will return the stack associated with the error if one is found.
LogOnCreation tells the error class and its descendents to log the stack whenever an error of this class is created.
LogWithStack will log the given messages with the current stack.
New is for compatibility with the default Go errors package.
NewBoundedErrorGroup makes a new ErrorGroup that will not track more than limit errors.
NewClass creates an error class with the provided name and options.
NewErrorGroup makes a new ErrorGroup.
NewErrorGroup make a new ErrorGroup that doesn't print the stacktrace.
NewLoggingErrorGroup returns a new LoggingErrorGroup with the given name.
NoCaptureStack is the opposite of CaptureStack and applies to the error, class, and its descendents.
NoLogOnCreation is the opposite of LogOnCreation and applies to the error, class, and its descendents.
Record will record the current pc on the given error if possible, adding to the error's recorded exits list.
RecordBefore will record the pc depth frames above the current stack frame on the given error if possible, adding to the error's recorded exits list.
SetData will take the given value and store it with the error or error class and its descendents associated with the given DataKey.
WrappedErr returns the wrapped error, if the current error is simply wrapping some previously returned error or system error.
# Constants
If IncludeWrapped is used, wrapped errors are also used for determining class membership.
# Variables
No description provided by the author
No description provided by the author
Config is a configuration struct meant to be used with github.com/spacemonkeygo/flagfile/utils.Setup but can be set independently.
No description provided by the author
from context.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
from syscall.
No description provided by the author
No description provided by the author
HierarchicalError is the base class for all hierarchical errors generated through this class.
No description provided by the author
from io.
Change this method if you want errors to log somehow else.
No description provided by the author
No description provided by the author
from net.
No description provided by the author
Useful error classes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
The following SystemError descendants are provided such that the GetClass method has something to return for standard library error types not defined through this class.
SystemError is the base error class for errors not generated through this errors library.
No description provided by the author
No description provided by the author
# Structs
DataKey's job is to make sure that keys in each error instances namespace are lexically scoped, thus helping developers not step on each others' toes between large packages.
Error is the type that represents a specific error instance.
ErrorClass is the basic hierarchical error type.
ErrorGroup is a type for collecting errors from a bunch of independent tasks.
LoggingErrorGroup is similar to ErrorGroup except that instead of collecting all of the errors, it logs the errors immediately and just counts how many non-nil errors have been seen.
# Interfaces
No description provided by the author
# Type aliases
EquivalenceOption values control behavior of determining whether or not an error belongs to a specific class.
An ErrorOption is something that controls behavior of specific error instances.