netxlite: improve docs, tests, and code quality (#493)
* netxlite: improve docs, tests, and code quality * better documentation * more strict testing of dialer (especially make sure we document the quirk in https://github.com/ooni/probe/issues/1779 and we have tests to guarantee we don't screw up here) * introduce NewErrWrapper factory for creating errors so we have confidence we are creating them correctly Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
e68adec9a5
commit
3cd88debdc
12 changed files with 452 additions and 141 deletions
|
|
@ -338,11 +338,8 @@ func (h *tlsHandshakerErrWrapper) Handshake(
|
|||
) (net.Conn, tls.ConnectionState, error) {
|
||||
tlsconn, state, err := h.TLSHandshaker.Handshake(ctx, conn, config)
|
||||
if err != nil {
|
||||
return nil, tls.ConnectionState{}, &errorsx.ErrWrapper{
|
||||
Failure: errorsx.ClassifyTLSHandshakeError(err),
|
||||
Operation: errorsx.TLSHandshakeOperation,
|
||||
WrappedErr: err,
|
||||
}
|
||||
return nil, tls.ConnectionState{}, errorsx.NewErrWrapper(
|
||||
errorsx.ClassifyTLSHandshakeError, errorsx.TLSHandshakeOperation, err)
|
||||
}
|
||||
return tlsconn, state, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue