Skip to content

Commit 790bd30

Browse files
committed
use CentApiResponseError name
1 parent 085e736 commit 790bd30

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cent/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
CentTransportError,
4545
CentUnauthorizedError,
4646
CentDecodeError,
47-
CentResponseError,
47+
CentApiResponseError,
4848
)
4949

5050
__all__ = (
@@ -54,10 +54,10 @@
5454
"BoolValue",
5555
"BroadcastRequest",
5656
"BroadcastResult",
57+
"CentApiResponseError",
5758
"CentDecodeError",
5859
"CentError",
5960
"CentNetworkError",
60-
"CentResponseError",
6161
"CentTransportError",
6262
"CentUnauthorizedError",
6363
"ChannelOptionsOverride",

cent/client/session/base_http.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from cent.exceptions import (
88
CentDecodeError,
9-
CentResponseError,
9+
CentApiResponseError,
1010
CentUnauthorizedError,
1111
CentTransportError,
1212
)
@@ -76,7 +76,7 @@ def check_response(
7676
raise CentDecodeError from err
7777

7878
if response.error:
79-
raise CentResponseError(
79+
raise CentApiResponseError(
8080
request=request,
8181
code=response.error.code,
8282
message=response.error.message,

cent/exceptions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ class CentDecodeError(CentError):
6161
"""
6262

6363

64-
class CentResponseError(CentError):
64+
class CentApiResponseError(CentError):
6565
"""
66-
CentAPIError raised when response from Centrifugo contains any error
67-
as a result of API command execution.
66+
CentApiResponseError raised when the response from Centrifugo server API contains
67+
any error as a result of API command execution.
6868
"""
6969

7070
def __init__(self, request: CentRequest[CentType], code: int, message: str) -> None:

tests/test_async_validation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from cent import (
55
AsyncClient,
6-
CentResponseError,
6+
CentApiResponseError,
77
PublishRequest,
88
StreamPosition,
99
Disconnect,
@@ -154,7 +154,7 @@ async def test_batch(async_client: AsyncClient) -> None:
154154

155155

156156
async def test_error_publish(async_client: AsyncClient) -> None:
157-
with pytest.raises(CentResponseError, match="unknown channel") as exc_info:
157+
with pytest.raises(CentApiResponseError, match="unknown channel") as exc_info:
158158
await async_client.publish(
159159
"undefined_channel:123",
160160
{"data": "data"},

tests/test_sync_validation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from cent import (
55
Client,
6-
CentResponseError,
6+
CentApiResponseError,
77
PublishRequest,
88
BroadcastRequest,
99
PresenceRequest,
@@ -155,7 +155,7 @@ def test_batch(sync_client: Client) -> None:
155155

156156

157157
def test_error_publish(sync_client: Client) -> None:
158-
with pytest.raises(CentResponseError, match="unknown channel") as exc_info:
158+
with pytest.raises(CentApiResponseError, match="unknown channel") as exc_info:
159159
sync_client.publish(
160160
"undefined_channel:123",
161161
{"data": "data"},

0 commit comments

Comments
 (0)