ax(mining): replace banned errors import with NewMiningError in circuit_breaker.go
ErrCircuitOpen used errors.New (banned import). Replaced with NewMiningError using the package's own error infrastructure. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
45a1dcc987
commit
a08f3e3d31
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package mining
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
|
@ -68,7 +67,8 @@ type CircuitBreaker struct {
|
|||
}
|
||||
|
||||
// ErrCircuitOpen is returned when the circuit is open
|
||||
var ErrCircuitOpen = errors.New("circuit breaker is open")
|
||||
// if err == ErrCircuitOpen { /* fallback to cached result */ }
|
||||
var ErrCircuitOpen = NewMiningError(ErrCodeServiceUnavailable, "circuit breaker is open")
|
||||
|
||||
// NewCircuitBreaker creates a new circuit breaker
|
||||
func NewCircuitBreaker(name string, config CircuitBreakerConfig) *CircuitBreaker {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue