Skip to content

Commit

Permalink
use CentApiResponseError name
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Feb 17, 2024
1 parent 085e736 commit 790bd30
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
CentTransportError,
CentUnauthorizedError,
CentDecodeError,
CentResponseError,
CentApiResponseError,
)

__all__ = (
Expand All @@ -54,10 +54,10 @@
"BoolValue",
"BroadcastRequest",
"BroadcastResult",
"CentApiResponseError",
"CentDecodeError",
"CentError",
"CentNetworkError",
"CentResponseError",
"CentTransportError",
"CentUnauthorizedError",
"ChannelOptionsOverride",
Expand Down
4 changes: 2 additions & 2 deletions cent/client/session/base_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from cent.exceptions import (
CentDecodeError,
CentResponseError,
CentApiResponseError,
CentUnauthorizedError,
CentTransportError,
)
Expand Down Expand Up @@ -76,7 +76,7 @@ def check_response(
raise CentDecodeError from err

if response.error:
raise CentResponseError(
raise CentApiResponseError(
request=request,
code=response.error.code,
message=response.error.message,
Expand Down
6 changes: 3 additions & 3 deletions cent/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class CentDecodeError(CentError):
"""


class CentResponseError(CentError):
class CentApiResponseError(CentError):
"""
CentAPIError raised when response from Centrifugo contains any error
as a result of API command execution.
CentApiResponseError raised when the response from Centrifugo server API contains
any error as a result of API command execution.
"""

def __init__(self, request: CentRequest[CentType], code: int, message: str) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_async_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from cent import (
AsyncClient,
CentResponseError,
CentApiResponseError,
PublishRequest,
StreamPosition,
Disconnect,
Expand Down Expand Up @@ -154,7 +154,7 @@ async def test_batch(async_client: AsyncClient) -> None:


async def test_error_publish(async_client: AsyncClient) -> None:
with pytest.raises(CentResponseError, match="unknown channel") as exc_info:
with pytest.raises(CentApiResponseError, match="unknown channel") as exc_info:
await async_client.publish(
"undefined_channel:123",
{"data": "data"},
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sync_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from cent import (
Client,
CentResponseError,
CentApiResponseError,
PublishRequest,
BroadcastRequest,
PresenceRequest,
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_batch(sync_client: Client) -> None:


def test_error_publish(sync_client: Client) -> None:
with pytest.raises(CentResponseError, match="unknown channel") as exc_info:
with pytest.raises(CentApiResponseError, match="unknown channel") as exc_info:
sync_client.publish(
"undefined_channel:123",
{"data": "data"},
Expand Down

0 comments on commit 790bd30

Please sign in to comment.