From f435843169003f2ccbbc2b30571da5e8abe3baf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Misbach?= Date: Fri, 9 Feb 2024 19:12:39 +0100 Subject: [PATCH] [uss_qualifier/resources/f3548/dss] Embed error message in QueryError (#504) --- .../uss_qualifier/resources/astm/f3548/v21/dss.py | 10 +++++----- .../astm/utm/off_nominal_planning/down_uss.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py b/monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py index 5d88143006..0b5452ab9c 100644 --- a/monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py +++ b/monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py @@ -3,7 +3,7 @@ import datetime import uuid from enum import Enum -from typing import Tuple, List, Dict, Optional +from typing import Tuple, List, Dict, Optional, Set from urllib.parse import urlparse import s2sphere @@ -137,7 +137,7 @@ def find_op_intent( ) if query.status_code != 200: raise QueryError( - f"Received code {query.status_code} when attempting to find operational intents in {extent}", + f"Received code {query.status_code} when attempting to find operational intents in {extent}{f'; error message: `{query.error_message}`' if query.error_message is not None else ''}", query, ) else: @@ -165,7 +165,7 @@ def get_op_intent_reference( ) if query.status_code != 200: raise QueryError( - f"Received code {query.status_code} when attempting to retrieve operational intent reference {op_intent_id}", + f"Received code {query.status_code} when attempting to retrieve operational intent reference {op_intent_id}{f'; error message: `{query.error_message}`' if query.error_message is not None else ''}", query, ) else: @@ -227,7 +227,7 @@ def get_op_intent_telemetry( return None, query elif query.status_code != 200: raise QueryError( - f"Received code {query.status_code} when attempting to retrieval operational intent telemetry for {op_intent_ref.id}", + f"Received code {query.status_code} when attempting to retrieval operational intent telemetry for {op_intent_ref.id}{f'; error message: `{query.error_message}`' if query.error_message is not None else ''}", query, ) else: @@ -311,7 +311,7 @@ def delete_op_intent( ) if query.status_code != 200: raise QueryError( - f"Received code {query.status_code} when attempting to delete operational intent {id}", + f"Received code {query.status_code} when attempting to delete operational intent {id}{f'; error message: `{query.error_message}`' if query.error_message is not None else ''}", query, ) else: diff --git a/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py b/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py index 880b21967d..fb30714858 100644 --- a/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py +++ b/monitoring/uss_qualifier/scenarios/astm/utm/off_nominal_planning/down_uss.py @@ -144,7 +144,7 @@ def _setup(self): dummy_query = e.queries[0] check.record_failed( summary="Failed to query DSS", - details=f"DSS responded code {dummy_query.status_code}; error message: {dummy_query.error_message}; {e}", + details=f"DSS responded code {dummy_query.status_code}; {e}", query_timestamps=[dummy_query.request.timestamp], ) self.uss_qualifier_sub = self.dss.client.auth_adapter.get_sub() @@ -291,7 +291,7 @@ def _clear_op_intents(self): find_query = e.queries[0] check.record_failed( summary=f"Failed to query operational intent references from DSS in {self._intents_extent} for cleanup", - details=f"DSS responded code {find_query.status_code}; error message: {find_query.error_message}; {e}", + details=f"DSS responded code {find_query.status_code}; {e}", query_timestamps=[find_query.request.timestamp], ) @@ -307,7 +307,7 @@ def _clear_op_intents(self): del_query = e.queries[0] check.record_failed( summary=f"Failed to delete op intent {oi_ref.id} from DSS", - details=f"DSS responded code {del_query.status_code}; error message: {del_query.error_message}; {e}", + details=f"DSS responded code {del_query.status_code}; {e}", query_timestamps=[del_query.request.timestamp], )