Skip to content

Commit

Permalink
[uss_qualifier/resources/f3548/dss] Embed error message in QueryError (
Browse files Browse the repository at this point in the history
  • Loading branch information
mickmis authored Feb 9, 2024
1 parent a31bf60 commit f435843
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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],
)

Expand All @@ -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],
)

Expand Down

0 comments on commit f435843

Please sign in to comment.