{"modulePath":"github.com/projectdiscovery/utils","version":"v0.11.17","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errorutil\n\nPackage errorutil provides error handling utilities.\n\nDeprecated: This package is deprecated and will be removed in a future version. Use github.com/projectdiscovery/utils/errkit instead, which provides better error handling with proper Go error chain support and optional stack traces.\n\nPackage errorutil provides error handling utilities.\n\nDeprecated: This package is deprecated and will be removed in a future version. Use github.com/projectdiscovery/utils/errkit instead.\n\nPackage errorutil provides error handling utilities.\n\nDeprecated: This package is deprecated and will be removed in a future version. Use github.com/projectdiscovery/utils/errkit instead.\n\nPackage errorutil provides error handling utilities.\n\nDeprecated: This package is deprecated and will be removed in a future version. Use github.com/projectdiscovery/utils/errkit instead.\n\nPackage errorutil provides error handling utilities.\n\nDeprecated: This package is deprecated and will be removed in a future version. Use github.com/projectdiscovery/utils/errkit instead.\n\n## Functions\n\n```go\nfunc IsAny(err error, errxx ...error) bool\n```\nIsAny checks if err is not nil and matches any one of errxx errors if match successful returns true else false\n\nDeprecated: Use standard library errors.Is instead.\n\n```go\nfunc IsTimeout(err error) bool\n```\nIsTimeout checks if error is timeout error\n\nDeprecated: Use standard library errors.Is with context.DeadlineExceeded instead.\n\n## Types\n\n```go\ntype ErrCallback func(level ErrorLevel, err string, tags ...string)\n```\nErrCallback function to handle given error\n\nDeprecated: Use errkit.ErrorX and its structured logging capabilities instead.\n\n```go\ntype ErrWithFmt struct {\n\t// contains filtered or unexported fields\n}\n```\nErrWithFmt is a simplified version of err holding a default format\n\nDeprecated: Use errkit.ErrorX instead.\n\n```go\nfunc NewWithFmt(fmt string) ErrWithFmt\n```\nNewWithFmt creates a new ErrWithFmt\n\nDeprecated: Use errkit.New instead.\n\n```go\nfunc (e *ErrWithFmt) Error()\n```\nError implements error interface\n\nDeprecated: Use errkit.ErrorX instead.\n\n```go\nfunc (e *ErrWithFmt) Msgf(args ...any) error\n```\nMsgf wraps given message\n\nDeprecated: Use errkit.ErrorX instead.\n\n```go\ntype Error interface {\n\t// WithTag assigns tag[s] to Error\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tWithTag(tag ...string) Error\n\t// WithLevel assigns given ErrorLevel\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tWithLevel(level ErrorLevel) Error\n\t// Error is interface method of 'error'\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tError() string\n\t// Unwrap returns the underlying error\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tUnwrap() error\n\t// Wraps existing error with errors (skips if passed error is nil)\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tWrap(err ...error) Error\n\t// Msgf wraps error with given message\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tMsgf(format string, args ...any) Error\n\t// Equal Checks Equality of errors\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tEqual(err ...error) bool\n\t// WithCallback execute ErrCallback function when Error is triggered\n\t//\n\t// Deprecated: Use errkit.ErrorX instead.\n\tWithCallback(handle ErrCallback) Error\n}\n```\nError is enriched version of normal error with tags and other methods\n\nDeprecated: Use errkit.ErrorX instead.\n\n```go\nfunc New(format string, args ...any) Error\n```\nNew creates a new error\n\nDeprecated: Use errkit.New instead.\n\n```go\nfunc NewWithErr(err error) Error\n```\nNewWithErr creates a new error with an existing error\n\nDeprecated: Use errkit.FromError instead.\n\n```go\nfunc NewWithTag(tag string, format string, args ...any) Error\n```\nNewWithTag creates an error with tag\n\nDeprecated: Use errkit.New instead.\n\n```go\nfunc WrapfWithNil(err error, format string, args ...any) Error\n```\nWrapfWithNil returns nil if error is nil but if err is not nil wraps error with given msg unlike errors.Wrapf\n\nDeprecated: Use errkit.FromError instead.\n\n```go\nfunc WrapwithNil(err error, errx ...error) Error\n```\nWrapwithNil returns nil if err is nil but wraps it with given errors continuously if it is not nil\n\nDeprecated: Use errkit.FromError instead.\n\n```go\ntype ErrorLevel uint\n```\nErrorLevel represents the severity level of an error\n\nDeprecated: Use errkit.ErrKind instead.\n\n```go\nconst (\n\t// Panic level error\n\t//\n\t// Deprecated: Use errkit.ErrKind instead.\n\tPanic ErrorLevel = iota\n\t// Fatal level error\n\t//\n\t// Deprecated: Use errkit.ErrKind instead.\n\tFatal\n\t// Runtime level error (Default)\n\t//\n\t// Deprecated: Use errkit.ErrKind instead.\n\tRuntime\n)\n```\n\n```go\nfunc (l ErrorLevel) String() string\n```\nString returns string representation of ErrorLevel\n\nDeprecated: Use errkit.ErrKind instead.\n\n","path":"github.com/projectdiscovery/utils/errors","name":"errorutil","synopsis":"Package errorutil provides error handling utilities.","isRedistributable":true}
