diff options
author | Clay Gerrard <clay.gerrard@gmail.com> | 2023-05-09 15:32:02 -0500 |
---|---|---|
committer | Clay Gerrard <clay.gerrard@gmail.com> | 2023-05-09 15:32:02 -0500 |
commit | 01a998a45114d852272679375bdcd7b8d0c1792a (patch) | |
tree | 8fe138ee837d1bb94254665ce24d5352b0d89395 | |
parent | 9d98721e7c94677ed06224b8f8c8c69e26793fec (diff) | |
download | swift-01a998a45114d852272679375bdcd7b8d0c1792a.tar.gz |
more explicit catch
Change-Id: I9fdc74d26fd830f463c077c912cdcf00eaab1dfa
-rw-r--r-- | swift/common/middleware/backend_ratelimit.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swift/common/middleware/backend_ratelimit.py b/swift/common/middleware/backend_ratelimit.py index 75e6e9741..b4922005f 100644 --- a/swift/common/middleware/backend_ratelimit.py +++ b/swift/common/middleware/backend_ratelimit.py @@ -17,7 +17,8 @@ import time from collections import defaultdict from swift.common.request_helpers import split_and_validate_path -from swift.common.swob import Request, HTTPTooManyBackendRequests +from swift.common.swob import Request, HTTPTooManyBackendRequests, \ + HTTPException from swift.common.utils import get_logger, non_negative_float, \ EventletRateLimiter @@ -66,7 +67,7 @@ class BackendRateLimitMiddleware(object): try: device, partition, _ = split_and_validate_path(req, 1, 3, True) int(partition) # check it's a valid partition - except Exception: # noqa + except (ValueError, HTTPException): # request may not have device/partition e.g. a healthcheck req pass else: |