Documentation
¶
Index ¶
- Constants
- Variables
- func AsCommonsError(err error) *commonsV1.Error
- func Cause(err error) error
- func Detail(err error) string
- func Error(code ErrorCode, message, detail string) error
- func ErrorInternal(code ErrorCode, message, detail string) error
- func HttpStatusCode(err error) int
- func Message(err error) string
- func Wrap(err error, code ErrorCode, message, detail string) error
- func WrapInternalError(err error, code ErrorCode, message, detail string) error
- type ErrorCode
- type ProxyError
Constants ¶
View Source
const ( Tcp110 string = "110" Tcp111 string = "111" Tcp113 string = "113" )
TCP socket errors
Variables ¶
Functions ¶
func AsCommonsError ¶
func ErrorInternal ¶
Error constructs a new error
func HttpStatusCode ¶
HttpStatusCode returns the http status code which will be sent to client
Types ¶
type ErrorCode ¶
type ErrorCode int32
ErrorCode is data type of error codes for different kind of errors
const ( ConnectFailed ErrorCode = -2 ConnectBroken ErrorCode = -3 HttpTimeout ErrorCode = -4 RuntimeException ErrorCode = -5 DomainLookupFailed ErrorCode = -6 EmptyResponse ErrorCode = -404 CanceledByBrowser ErrorCode = -5011 PrecludedByRobots ErrorCode = -9998 )
See https://heritrix.readthedocs.io/en/latest/glossary.html for the original Heritrix error codes.
type ProxyError ¶
type ProxyError struct {
// contains filtered or unexported fields
}
ProxyError is the struct of recorder proxy error
func (*ProxyError) Cause ¶
func (e *ProxyError) Cause() error
func (*ProxyError) Code ¶
func (e *ProxyError) Code() ErrorCode
func (*ProxyError) Detail ¶
func (e *ProxyError) Detail() string
func (*ProxyError) Error ¶
func (e *ProxyError) Error() string
func (*ProxyError) HttpStatusCode ¶
func (e *ProxyError) HttpStatusCode() int
func (*ProxyError) Message ¶
func (e *ProxyError) Message() string
func (*ProxyError) Unwrap ¶ added in v0.8.0
func (e *ProxyError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.