Chore: use errors.ErrUnsupported (#294)

This commit is contained in:
Jason Lyu
2023-09-05 01:51:03 +08:00
committed by GitHub
parent b470006fb6
commit f448baa2ae
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ func (b *Base) Proto() proto.Proto {
}
func (b *Base) DialContext(context.Context, *M.Metadata) (net.Conn, error) {
return nil, errors.New("not supported")
return nil, errors.ErrUnsupported
}
func (b *Base) DialUDP(*M.Metadata) (net.PacketConn, error) {
return nil, errors.New("not supported")
return nil, errors.ErrUnsupported
}
+1 -1
View File
@@ -65,7 +65,7 @@ func (ss *Socks5) DialContext(ctx context.Context, metadata *M.Metadata) (c net.
func (ss *Socks5) DialUDP(*M.Metadata) (_ net.PacketConn, err error) {
if ss.unix {
return nil, errors.New("not supported when unix domain socket is enabled")
return nil, fmt.Errorf("%w when unix domain socket is enabled", errors.ErrUnsupported)
}
ctx, cancel := context.WithTimeout(context.Background(), tcpConnectTimeout)