Skip to content

Commit

Permalink
adds service unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Dec 11, 2023
1 parent b897c11 commit 7b659ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
PaymentMethodNotFoundError,
PaymentMethodUniqueViolationError,
PaymentNotFoundError,
PaymentServiceUnavailableError,
)
from pydantic.errors import PydanticErrorMixin

Expand All @@ -13,6 +14,7 @@
"PaymentMethodNotFoundError",
"PaymentMethodUniqueViolationError",
"PaymentNotFoundError",
"PaymentServiceUnavailableError",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
PaymentMethodNotFoundError,
PaymentMethodUniqueViolationError,
PaymentNotFoundError,
PaymentServiceUnavailableError,
PaymentUniqueViolationError,
)
from ..products.errors import ProductPriceNotDefinedError
Expand Down Expand Up @@ -67,11 +68,14 @@ async def wrapper(request: web.Request) -> web.StreamResponse:
) as exc:
raise web.HTTPConflict(reason=f"{exc}") from exc

except PaymentServiceUnavailableError as exc:
raise web.HTTPServiceUnavailable(reason=f"{exc}") from exc

except WalletAccessForbiddenError as exc:
raise web.HTTPForbidden(reason=f"{exc}") from exc

except ProductPriceNotDefinedError as exc:
raise web.HTTPConflict(reason=MSG_PRICE_NOT_DEFINED_ERROR)
raise web.HTTPConflict(reason=MSG_PRICE_NOT_DEFINED_ERROR) from exc

return wrapper

Expand Down

0 comments on commit 7b659ff

Please sign in to comment.