From 874dc277458997ac65b173f72c08e0d8d50b65ac Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 1 Dec 2017 22:10:48 +0900 Subject: [PATCH] ing --- client/client.go | 5 +++-- servlet.go | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/client.go b/client/client.go index 0a31a76..0466202 100644 --- a/client/client.go +++ b/client/client.go @@ -62,7 +62,7 @@ func (c *client) Connect() error { c.rwcHandler.Validate() if c.stopChan != nil { - panic("RPC Client: the given client is already started. Call Client.Stop() before calling Client.Start() again!") + return fmt.Errorf("RPC Client: the given client is already started. Call Client.Stop() before calling Client.Start() again") } c.ctx = c.ch.ClientContext(nil) @@ -84,7 +84,8 @@ func (c *client) Connect() error { func (c *client) Close() { if c.stopChan == nil { - panic("RPC Client: the client must be started before stopping it") + logging.Logger().Warn("RPC Client: the client must be started before stopping it") + return } c.ch.Destroy(c.ctx) diff --git a/servlet.go b/servlet.go index cf2ad14..99a9482 100644 --- a/servlet.go +++ b/servlet.go @@ -104,7 +104,8 @@ func (s *rpcServlet) Context() ServletContext { func (s *rpcServlet) destroy(err error) { if s.stopChan == nil { - panic("Server: server must be started before stopping it") + logging.Logger().Warn("Server: server must be started before stopping it") + return } close(s.stopChan)