summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server_config.go2
-rw-r--r--server_config_test.go8
-rw-r--r--static_pool.go1
3 files changed, 9 insertions, 2 deletions
diff --git a/server_config.go b/server_config.go
index 54f7120b..ad708e10 100644
--- a/server_config.go
+++ b/server_config.go
@@ -41,7 +41,7 @@ func (cfg *ServerConfig) makeFactory() (Factory, error) {
ln, err := net.Listen(dsn[0], dsn[1])
if err != nil {
- return nil, nil
+ return nil, err
}
return NewSocketFactory(ln, cfg.RelayTimeout), nil
diff --git a/server_config_test.go b/server_config_test.go
index 521b07b9..74878782 100644
--- a/server_config_test.go
+++ b/server_config_test.go
@@ -73,3 +73,11 @@ func Test_ServerConfig_ErrorFactory(t *testing.T) {
assert.Error(t, err)
assert.Equal(t, "invalid relay DSN (pipes, tcp://:6001, unix://rr.sock)", err.Error())
}
+
+func Test_ServerConfig_ErrorMethod(t *testing.T) {
+ cfg := &ServerConfig{Relay: "xinu://unix.sock"}
+
+ f, err := cfg.makeFactory()
+ assert.Nil(t, f)
+ assert.Error(t, err)
+}
diff --git a/static_pool.go b/static_pool.go
index a04190dd..f4652bfc 100644
--- a/static_pool.go
+++ b/static_pool.go
@@ -58,7 +58,6 @@ func NewPool(cmd func() *exec.Cmd, factory Factory, cfg Config) (*StaticPool, er
for i := uint64(0); i < p.cfg.NumWorkers; i++ {
// to test if worker ready
w, err := p.createWorker()
-
if err != nil {
p.Destroy()
return nil, err