Affected by GO-2024-2924
and 1 other vulnerabilities
GO-2024-2924: AdGuardHome privilege escalation vulnerability in github.com/AdguardTeam/AdGuardHome
GO-2024-3184: Adguard Home arbitrary file read vulnerability in github.com/AdguardTeam/AdGuardHome
package
Version:
v0.106.0-b.3
Opens a new window with list of versions in this module.
Published: Apr 19, 2021
License: GPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package agherr contains AdGuard Home's error handling helpers.
func Annotate(msg string, errPtr *error, args ...interface{})
Annotate annotates the error with the message, unless the error is nil. This
is a helper function to simplify code like this:
func (f *foo) doStuff(s string) (err error) {
defer func() {
if err != nil {
err = fmt.Errorf("bad foo string %q: %w", s, err)
}
}()
// …
}
Instead, write:
func (f *foo) doStuff(s string) (err error) {
defer agherr.Annotate("bad foo string %q: %w", &err, s)
// …
}
msg must contain the final ": %w" verb.
TODO(a.garipov): Clearify the function usage.
LogPanic is a convinient helper function to log a panic in a goroutine. It
should not be used where proper error handling is required.
Many wraps several errors and returns a single error.
TODO(a.garipov): Add formatting to message.
Error is the constant error type.
Error implements the error interface for Error.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.