Chore: throw more detail dial error
This commit is contained in:
@ -30,7 +30,7 @@ type SnellOption struct {
|
||||
func (s *Snell) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, error) {
|
||||
c, err := dialContext(ctx, "tcp", s.server)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s connect error: %s", s.server, err.Error())
|
||||
return nil, fmt.Errorf("%s connect error: %w", s.server, err)
|
||||
}
|
||||
tcpKeepAlive(c)
|
||||
switch s.obfsOption.Mode {
|
||||
@ -53,7 +53,7 @@ func NewSnell(option SnellOption) (*Snell, error) {
|
||||
decoder := structure.NewDecoder(structure.Option{TagName: "obfs", WeaklyTypedInput: true})
|
||||
obfsOption := &simpleObfsOption{Host: "bing.com"}
|
||||
if err := decoder.Decode(option.ObfsOpts, obfsOption); err != nil {
|
||||
return nil, fmt.Errorf("snell %s initialize obfs error: %s", server, err.Error())
|
||||
return nil, fmt.Errorf("snell %s initialize obfs error: %w", server, err)
|
||||
}
|
||||
|
||||
if obfsOption.Mode != "tls" && obfsOption.Mode != "http" {
|
||||
|
Reference in New Issue
Block a user