diff --git a/client/socket.go b/client/socket.go index 1bb14db..ffa52de 100644 --- a/client/socket.go +++ b/client/socket.go @@ -1,6 +1,7 @@ package client import ( + "fmt" "io" "net" "net/http" @@ -169,6 +170,9 @@ func NewSocket(sb SocketBuilder, parentContext cuc.Context) (Socket, error) { d.Jar = sb.GetRequestCookie() url := sb.GetURL() + if "" == url { + return nil, fmt.Errorf("Client Socket: URL of server must be specified") + } reqHeader := sb.GetRequestHeader() conn, res, err := d.Dial(url, reqHeader) diff --git a/client/socket_builders.go b/client/socket_builders.go index b10d7d0..58b245d 100644 --- a/client/socket_builders.go +++ b/client/socket_builders.go @@ -7,7 +7,6 @@ import ( "net/url" "time" - "git.loafle.net/commons_go/logging" cuc "git.loafle.net/commons_go/util/context" cwf "git.loafle.net/commons_go/websocket_fasthttp" ) @@ -84,10 +83,6 @@ func (sb *SocketBuilders) GetWriteBufferSize() int { } func (sb *SocketBuilders) Validate() { - if "" == sb.URL { - logging.Logger().Panic("Client Socket: URL must be specified") - } - if 0 >= sb.HandshakeTimeout { sb.HandshakeTimeout = cwf.DefaultHandshakeTimeout }