ax(mining): replace banned errors import with NewMiningError in circuit_breaker.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

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:
Claude 2026-04-02 07:55:17 +01:00
parent 45a1dcc987
commit a08f3e3d31
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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 {