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
|
|
@ -210,6 +210,16 @@ func TestClassifyQUICHandshakeError(t *testing.T) {
|
|||
}
|
||||
})
|
||||
|
||||
t.Run("for a TransportError wrapping an OONI error", func(t *testing.T) {
|
||||
err := &quic.TransportError{
|
||||
ErrorCode: quic.InternalError,
|
||||
ErrorMessage: FailureHostUnreachable,
|
||||
}
|
||||
if ClassifyQUICHandshakeError(err) != FailureHostUnreachable {
|
||||
t.Fatal("unexpected results")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("for another kind of error", func(t *testing.T) {
|
||||
if ClassifyQUICHandshakeError(io.EOF) != FailureEOFError {
|
||||
t.Fatal("unexpected result")
|
||||
|
|
|
|||
Loading…
Reference in a new issue