fix(quic): properly unwrap OONI errors from TransportError (#495)
Noticed while playing around with QUIC code. Part of https://github.com/ooni/probe/issues/1544.
This commit is contained in:
parent
50b58672c6
commit
00a85cb7f0
10 changed files with 128 additions and 27 deletions
|
|
@ -179,6 +179,16 @@ func ClassifyQUICHandshakeError(err error) string {
|
|||
if errCode == quicTLSUnrecognizedName {
|
||||
return FailureSSLInvalidHostname
|
||||
}
|
||||
|
||||
// quic.TransportError wraps OONI errors using the error
|
||||
// code quic.InternalError. So, if the error code is
|
||||
// an internal error, search for a OONI error and, if
|
||||
// found, just return such an error.
|
||||
if transportError.ErrorCode == quic.InternalError {
|
||||
if s := failuresMap[transportError.ErrorMessage]; s != "" {
|
||||
return s
|
||||
}
|
||||
}
|
||||
}
|
||||
return ClassifyGenericError(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue