completed inbound pool. Refactored to inbound/outbound semantics.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package outbound
|
||||
|
||||
import "errors"
|
||||
import "fmt"
|
||||
|
||||
var (
|
||||
// Config errors
|
||||
InvalidKeepaliveTimeout = errors.New("keepalive timeout cannot be negative")
|
||||
InvalidMaxQueueSize = errors.New("maximum queue size cannot be negative")
|
||||
|
||||
// Pool errors
|
||||
ErrPoolClosed = errors.New("pool is closed")
|
||||
ErrPeerNotFound = errors.New("peer not found")
|
||||
ErrPeerExists = errors.New("peer already exists")
|
||||
|
||||
// Worker errors
|
||||
ErrConnectionUnavailable = errors.New("connection unavailable")
|
||||
)
|
||||
|
||||
func NewConfigError(err error) error {
|
||||
return fmt.Errorf("configuration error: %w", err)
|
||||
}
|
||||
|
||||
func NewPoolError(err error) error {
|
||||
return fmt.Errorf("pool error: %w", err)
|
||||
}
|
||||
|
||||
func NewWorkerError(id string, err error) error {
|
||||
return fmt.Errorf("worker %q error: %w", id, err)
|
||||
}
|
||||
Reference in New Issue
Block a user