diff options
| author | chrislu <chris.lu@gmail.com> | 2023-10-05 08:15:11 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-10-05 08:15:11 -0700 |
| commit | 7b3c63a8afa5bd305437f6913774c0e1e76eb569 (patch) | |
| tree | 6a07bde8bbb9fe4c5da128ae4b0d120bb60b6a1f | |
| parent | 4e493d596c4bf200e29b351b9ede7921d23e74e9 (diff) | |
| download | seaweedfs-7b3c63a8afa5bd305437f6913774c0e1e76eb569.tar.xz seaweedfs-7b3c63a8afa5bd305437f6913774c0e1e76eb569.zip | |
handle wrapped errors
| -rw-r--r-- | weed/s3api/s3api_circuit_breaker.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/s3api/s3api_circuit_breaker.go b/weed/s3api/s3api_circuit_breaker.go index 9e197a2f9..6e14da0af 100644 --- a/weed/s3api/s3api_circuit_breaker.go +++ b/weed/s3api/s3api_circuit_breaker.go @@ -1,6 +1,7 @@ package s3api import ( + "errors" "fmt" "github.com/gorilla/mux" "github.com/seaweedfs/seaweedfs/weed/filer" @@ -30,7 +31,7 @@ func NewCircuitBreaker(option *S3ApiServerOption) *CircuitBreaker { err := pb.WithFilerClient(false, 0, option.Filer, option.GrpcDialOption, func(client filer_pb.SeaweedFilerClient) error { content, err := filer.ReadInsideFiler(client, s3_constants.CircuitBreakerConfigDir, s3_constants.CircuitBreakerConfigFile) - if err == filer_pb.ErrNotFound { + if errors.Is(err, filer_pb.ErrNotFound) { glog.Infof("s3 circuit breaker not configured") return nil } |
