refactor(errorsx): start hiding private details and moving around stuff (#424)
* refactor(errorsx): start hiding private details and moving around stuff Part of https://github.com/ooni/probe/issues/1505 * fix: remove now-addressed todo comments
This commit is contained in:
parent
ceb2aa8a8d
commit
17bfb052c5
8 changed files with 235 additions and 236 deletions
48
internal/errorsx/failures.go
Normal file
48
internal/errorsx/failures.go
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
package errorsx
|
||||
|
||||
// This enumeration lists all the failures defined at
|
||||
// https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md
|
||||
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"
|
||||
|
||||
// FailureDNSNXDOMAINError means we got NXDOMAIN in DNS reply.
|
||||
FailureDNSNXDOMAINError = "dns_nxdomain_error"
|
||||
|
||||
// FailureEOFError means we got unexpected EOF on connection.
|
||||
FailureEOFError = "eof_error"
|
||||
|
||||
// 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"
|
||||
|
||||
// FailureSSLHandshake means that the negotiation of cryptographic parameters failed
|
||||
FailureSSLHandshake = "ssl_failed_handshake"
|
||||
|
||||
// FailureSSLInvalidHostname means we got certificate is not valid for SNI.
|
||||
FailureSSLInvalidHostname = "ssl_invalid_hostname"
|
||||
|
||||
// FailureSSLUnknownAuthority means we cannot find CA validating certificate.
|
||||
FailureSSLUnknownAuthority = "ssl_unknown_authority"
|
||||
|
||||
// FailureSSLInvalidCertificate means certificate experired or other
|
||||
// sort of errors causing it to be invalid.
|
||||
FailureSSLInvalidCertificate = "ssl_invalid_certificate"
|
||||
|
||||
// FailureJSONParseError indicates that we couldn't parse a JSON
|
||||
FailureJSONParseError = "json_parse_error"
|
||||
)
|
||||
Loading…
Reference in a new issue