1 Star 0 Fork 0

zhangjungang/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
errors.go 988 Bytes
一键复制 编辑 原始数据 按行查看 历史
package dns
// All dns protocol errors are defined here.
type Error interface {
error
ResponseError() string
}
type DNSError struct {
Err string
}
func (e *DNSError) Error() string {
if e == nil {
return "<nil>"
}
return e.Err
}
func (e *DNSError) ResponseError() string {
return "Response: " + e.Error()
}
// Messages
var (
NonDnsMsg = &DNSError{Err: "Message's data could not be decoded as DNS"}
ZeroLengthMsg = &DNSError{Err: "Message's length was set to zero"}
UnexpectedLengthMsg = &DNSError{Err: "Unexpected message data length"}
DuplicateQueryMsg = &DNSError{Err: "Another query with the same DNS ID from this client " +
"was received so this query was closed without receiving a response"}
IncompleteMsg = &DNSError{Err: "Message's data is incomplete"}
NoResponse = &DNSError{Err: "No response to this query was received"}
)
// TCP responses
var (
OrphanedResponse = &DNSError{Err: "Response: received without an associated Query"}
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v1.1.0

搜索帮助