summaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-11 13:00:52 +0300
committerValery Piashchynski <[email protected]>2021-01-11 13:00:52 +0300
commitc4112cd214a9c7cbed82c82eefc75904fb42d1af (patch)
tree680cc5f0d3f9a0d78a944e026568af61c12bd87e /server.go
parent5dc83ef5eee77f4d1ef557e5f8b566e75892680d (diff)
Update CI
Format imports and code Distinct internal and app errors
Diffstat (limited to 'server.go')
-rw-r--r--server.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/server.go b/server.go
index 406bc0a0..a0eb8fcf 100644
--- a/server.go
+++ b/server.go
@@ -1,9 +1,9 @@
package roadrunner
import (
- "fmt"
- "github.com/pkg/errors"
"sync"
+
+ "github.com/pkg/errors"
)
const (
@@ -133,11 +133,13 @@ func (s *Server) Stop() {
s.throw(EventServerStop, s)
}
+var ErrNoAssociatedPool = errors.New("no associared pool")
+
// Exec one task with given payload and context, returns result or error.
func (s *Server) Exec(rqs *Payload) (rsp *Payload, err error) {
pool := s.Pool()
if pool == nil {
- return nil, fmt.Errorf("no associared pool")
+ return nil, ErrNoAssociatedPool
}
return pool.Exec(rqs)