From a55e85b8c55b23845644b77e46236fa5409169cb Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Mon, 11 Dec 2023 20:10:49 +0100 Subject: [PATCH] raises unavailable --- services/payments/src/simcore_service_payments/_constants.py | 2 +- .../src/simcore_service_payments/services/payments_gateway.py | 4 ++-- services/payments/tests/unit/test_rpc_payments.py | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/services/payments/src/simcore_service_payments/_constants.py b/services/payments/src/simcore_service_payments/_constants.py index d4768c5d8600..a9bfd404c56f 100644 --- a/services/payments/src/simcore_service_payments/_constants.py +++ b/services/payments/src/simcore_service_payments/_constants.py @@ -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" diff --git a/services/payments/src/simcore_service_payments/services/payments_gateway.py b/services/payments/src/simcore_service_payments/services/payments_gateway.py index 5a1fb4247c9d..6ea66bedb59c 100644 --- a/services/payments/src/simcore_service_payments/services/payments_gateway.py +++ b/services/payments/src/simcore_service_payments/services/payments_gateway.py @@ -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: @@ -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 diff --git a/services/payments/tests/unit/test_rpc_payments.py b/services/payments/tests/unit/test_rpc_payments.py index 1b78b6fa8592..e64a499d6f66 100644 --- a/services/payments/tests/unit/test_rpc_payments.py +++ b/services/payments/tests/unit/test_rpc_payments.py @@ -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)