mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
Chore: use errors.ErrUnsupported (#294)
This commit is contained in:
+2
-2
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user