Skip to content

Commit

Permalink
raises unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Dec 12, 2023
1 parent 39f310a commit a55e85b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
RUT: Final[str] = "Resource Usage Tracker service"


MSG_GATEWAY_UNAVAILABLE_ERROR = "Our payments provider is temporary unavailable"
MSG_GATEWAY_UNAVAILABLE_ERROR = "Our payments provider is temporary innoperative"
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _reraise_as_service_errors_context(operation_id: str):
except httpx.RequestError as err:
_logger.exception("%s: request error", PAG)
raise PaymentServiceUnavailableError(
human_reason=MSG_GATEWAY_UNAVAILABLE_ERROR
human_readable_detail=MSG_GATEWAY_UNAVAILABLE_ERROR
) from err

except httpx.HTTPStatusError as err:
Expand All @@ -106,7 +106,7 @@ def _reraise_as_service_errors_context(operation_id: str):
# 5XX in server -> turn into unavailable
_logger.exception(error.get_detailed_message())
raise PaymentServiceUnavailableError(
human_reason=MSG_GATEWAY_UNAVAILABLE_ERROR
human_readable_detail=MSG_GATEWAY_UNAVAILABLE_ERROR
) from err


Expand Down
1 change: 0 additions & 1 deletion services/payments/tests/unit/test_rpc_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ async def test_rpc_init_payment_fail(
timeout_s=None if is_pdb_enabled else 5,
)

# FIXME: should raise
assert isinstance(exc_info.value, PaymentServiceUnavailableError)


Expand Down

0 comments on commit a55e85b

Please sign in to comment.