-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
⚙️ bot-apiaffected functionality: bot-apiaffected functionality: bot-api🛠 breakingchange type: breakingchange type: breaking
Milestone
Description
python-telegram-bot/telegram/utils/request.py
Lines 268 to 280 in ff3fd34
| if resp.status in (401, 403): | |
| raise Unauthorized(message) | |
| elif resp.status == 400: | |
| raise BadRequest(message) | |
| elif resp.status == 404: | |
| raise InvalidToken() | |
| elif resp.status == 409: | |
| raise Conflict(message) | |
| elif resp.status == 413: | |
| raise NetworkError( | |
| 'File too large. Check telegram api limits ' | |
| 'https://core.telegram.org/bots/api#senddocument' | |
| ) |
We currently raise InvalidToken for 404, though 404 seems to be raised when requesting non-existing methods.
Unauthorized (=401) is the acutal InvalidToken and 403 gives Forbidden. So
- 401 ->
Unauthorized - 403 ->
Forbidden - drop
InvalidToken/only use it inBot._validate_token
I do think we should update that. However those are pretty much breaking changes, so probably only in the next major release …
ruizlenatoruizlenatoruizlenato
Metadata
Metadata
Assignees
Labels
⚙️ bot-apiaffected functionality: bot-apiaffected functionality: bot-api🛠 breakingchange type: breakingchange type: breaking