From 963050b50838fcc3a248efc1ac5aac9a3c22a3e4 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 24 Dec 2025 11:14:25 +0900 Subject: [PATCH] Create dedicated exception for aggregation method not found ... so that we can detect 404 caused by missing aggregation method, instead of missing metric. --- gnocchiclient/exceptions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnocchiclient/exceptions.py b/gnocchiclient/exceptions.py index 0298f4f..02f4288 100644 --- a/gnocchiclient/exceptions.py +++ b/gnocchiclient/exceptions.py @@ -120,6 +120,11 @@ class ArchivePolicyRuleNotFound(NotFound): match = re.compile("Archive policy rule .* does not exist") +class AggregationMethodNotFound(NotFound): + message = "Aggregation method not found" + match = re.compile("Aggregation method does not exist for this metric") + + class MethodNotAllowed(ClientException): """HTTP 405 - Method Not Allowed."""