mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-26 22:00:27 +08:00
fix(p2p): handle error on parsing endpoint
This commit is contained in:
@@ -12,7 +12,7 @@ var (
|
||||
ErrEndpointTypeMistatch = errors.New("endpoint type mismatch")
|
||||
)
|
||||
|
||||
type Initializer func(endpoint string, configs ...any) EndPoint
|
||||
type Initializer func(endpoint string, configs ...any) (EndPoint, error)
|
||||
|
||||
var factory syncx.Map[string, Initializer]
|
||||
|
||||
@@ -32,7 +32,7 @@ func NewEndPoint(network, endpoint string, configs ...any) (EndPoint, error) {
|
||||
if !ok {
|
||||
return nil, errors.New("network " + network + " not found")
|
||||
}
|
||||
return initializer(endpoint, configs...), nil
|
||||
return initializer(endpoint, configs...)
|
||||
}
|
||||
|
||||
type Conn interface {
|
||||
|
||||
Reference in New Issue
Block a user