fix(netxlite): map servfail error (#728)
This error occurred for example when querying kazemjalali.com
in websteps measurements run from Iran.
This error is relatively uncommon, but it still makes sense to
create a specific mapping rule for it.
Originally: 4269e82fbd
See https://github.com/ooni/probe/issues/2096
This commit is contained in:
parent
b872dd0e1e
commit
5904e6988d
7 changed files with 34 additions and 3 deletions
|
|
@ -248,11 +248,17 @@ const (
|
|||
// unexported errors used by the Go standard library.
|
||||
var (
|
||||
ErrOODNSNoSuchHost = fmt.Errorf("ooniresolver: %s", DNSNoSuchHostSuffix)
|
||||
ErrOODNSRefused = errors.New("ooniresolver: refused")
|
||||
ErrOODNSMisbehaving = fmt.Errorf("ooniresolver: %s", DNSServerMisbehavingSuffix)
|
||||
ErrOODNSNoAnswer = fmt.Errorf("ooniresolver: %s", DNSNoAnswerSuffix)
|
||||
)
|
||||
|
||||
// These errors are not part of the Go standard library but we can
|
||||
// return them in our custom resolvers.
|
||||
var (
|
||||
ErrOODNSRefused = errors.New("ooniresolver: refused")
|
||||
ErrOODNSServfail = errors.New("ooniresolver: servfail")
|
||||
)
|
||||
|
||||
// classifyResolverError maps DNS resolution errors to
|
||||
// OONI failure strings.
|
||||
//
|
||||
|
|
@ -278,6 +284,9 @@ func classifyResolverError(err error) string {
|
|||
if errors.Is(err, ErrOODNSRefused) {
|
||||
return FailureDNSRefusedError // not in MK
|
||||
}
|
||||
if errors.Is(err, ErrOODNSServfail) {
|
||||
return FailureDNSServfailError
|
||||
}
|
||||
return classifyGenericError(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue