Debian Codegraph @

internal/unpack/errors.go

raw
1 package unpack
2
3 import "fmt"
4
5 // Error represents an unpacking error.
6 type Error struct{ Err string }
7
8 func (e *Error) Error() string { return "dns unpack: " + e.Err }
9
10 func Errorf(format string, a ...any) *Error { return &Error{Err: fmt.Sprintf(format, a...)} }
11
12 var (
13 ErrOverflow = &Error{Err: "overflow data"}
14 ErrTruncatedMessage = &Error{Err: "overflow truncated message"}
15 ErrTrailingData = &Error{Err: "trailing record rdata"}
16 )