Skip to content

Commit 9ddebbb

Browse files
committed
fix: remove duplicate exception
1 parent ba3f62a commit 9ddebbb

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

pybotx/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
ChatCreationProhibitedError,
4141
InvalidUsersListError,
4242
ThreadCreationError,
43-
ThreadCreationEventNotFoundError,
4443
ThreadCreationProhibitedError,
4544
)
4645
from pybotx.client.exceptions.common import (

pybotx/client/chats_api/create_thread.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import typing
21
from typing import Literal
32
from uuid import UUID
43

54
from pybotx.client.authorized_botx_method import AuthorizedBotXMethod
65
from pybotx.client.botx_method import response_exception_thrower
76
from pybotx.client.exceptions.chats import (
87
ThreadCreationError,
9-
ThreadCreationEventNotFoundError,
108
ThreadCreationProhibitedError,
119
)
10+
from pybotx.client.exceptions.event import EventNotFoundError
1211
from pybotx.models.api_base import UnverifiedPayloadBaseModel, VerifiedPayloadBaseModel
1312

1413

@@ -36,7 +35,7 @@ class CreateThreadMethod(AuthorizedBotXMethod):
3635
status_handlers = {
3736
**AuthorizedBotXMethod.status_handlers,
3837
403: response_exception_thrower(ThreadCreationProhibitedError),
39-
404: response_exception_thrower(ThreadCreationEventNotFoundError),
38+
404: response_exception_thrower(EventNotFoundError),
4039
422: response_exception_thrower(ThreadCreationError),
4140
}
4241

pybotx/client/exceptions/chats.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,3 @@ class ThreadCreationProhibitedError(BaseClientError):
3434
9. Message in stealth mode
3535
10. Message is deleted
3636
"""
37-
38-
39-
class ThreadCreationEventNotFoundError(BaseClientError):
40-
"""Event not found"""

tests/client/chats_api/test_create_thread.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from pybotx import (
1010
Bot,
1111
BotAccountWithSecret,
12+
EventNotFoundError,
1213
HandlerCollector,
1314
ThreadCreationError,
14-
ThreadCreationEventNotFoundError,
1515
ThreadCreationProhibitedError,
1616
lifespan_wrapper,
1717
)
@@ -173,7 +173,7 @@ async def test__create_chat__succeed(
173173
"error_data": {"bot_id": "24348246-6791-4ac0-9d86-b948cd6a0e46"},
174174
},
175175
HTTPStatus.NOT_FOUND,
176-
ThreadCreationEventNotFoundError,
176+
EventNotFoundError,
177177
),
178178
(
179179
{

0 commit comments

Comments
 (0)