feat(errorsx): cover more syscall errors and add tests (#430)

* feat(errorsx): cover more syscall errors and add tests

Part of https://github.com/ooni/probe/issues/1505

* fix tests
This commit is contained in:
Simone Basso 2021-07-08 12:23:37 +02:00 committed by GitHub
commit 14c1640f7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 293 additions and 48 deletions

View file

@ -1,14 +1,11 @@
package errorsx
// This enumeration lists all the failures defined at
// This enumeration lists the non-syscall-derived failures defined at
// https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md
//
// See also the enumeration at errno.go for the failures that
// derive directly from system call errors.
const (
// FailureConnectionRefused means ECONNREFUSED.
FailureConnectionRefused = "connection_refused"
// FailureConnectionReset means ECONNRESET.
FailureConnectionReset = "connection_reset"
// FailureDNSBogonError means we detected bogon in DNS reply.
FailureDNSBogonError = "dns_bogon_error"
@ -21,12 +18,6 @@ const (
// FailureGenericTimeoutError means we got some timer has expired.
FailureGenericTimeoutError = "generic_timeout_error"
// FailureHostUnreachable means that there is "no route to host".
FailureHostUnreachable = "host_unreachable"
// FailureInterrupted means that the user interrupted us.
FailureInterrupted = "interrupted"
// FailureNoCompatibleQUICVersion means that the server does not support the proposed QUIC version
FailureNoCompatibleQUICVersion = "quic_incompatible_version"