We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[FEATURE] More fine grained network exceptions
### What kind of feature are you missing? Where do you notice a shortcoming of PTB?

We currently only have `NetworkError` and `TimeoutError(NetworkError)` to indicate exceptions that are due to natworking problems (in contrast to exceptions issued by TG). This is not very fine grained and can make advanced exception handling difficult.

### Describe the solution you'd like

I'd like to add more subclasses. Looking it httpx, they have a [large number of them](https://github.com/encode/httpx/blob/2e2949c8ea88668f4cc5e509342b57e60fe4d86a/httpx/_exceptions.py#L1-L32). Not all of them add much value for us IMO. In the following I list all of the httpx excetpions and check the ones that I think would make sense to have for us:

- [ ] HTTPError
  - [ ] RequestError
    - [ ] TransportError
      - [x] TimeoutException ( (corresponds to `tg.TimeoutError`)
        - [x] ConnectTimeout
        - [x] ReadTimeout
        - [x] WriteTimeout
        - [x] PoolTimeout
      - [x] NetworkError (corresponds to `tg.NetworkError`)
        - [x] ConnectError
        - [x] ReadError
        - [x] WriteError
        - [x] CloseError
      - [ ] ProtocolError
        - [ ] LocalProtocolError
        - [ ] RemoteProtocolError
      - [x] ProxyError
      - [ ] UnsupportedProtocol
    - [ ] DecodingError
    - [ ] TooManyRedirects
  - [ ] HTTPStatusError
- [ ] InvalidURL
- [ ] CookieConflict
- [ ] StreamError
  - [ ] StreamConsumed
  - [ ] StreamClosed
  - [ ] ResponseNotRead
  - [ ] RequestNotRead

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `telegram/error.py`
Content:
```
1 #!/usr/bin/env python
2 #
3 # A library that provides a Python interface to the Telegram Bot API
4 # Copyright (C) 2015-2023
5 # Leandro Toledo de Souza <devs@python-telegram-bot.org>
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU Lesser Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser Public License
18 # along with this program.  If not, see [http://www.gnu.org/licenses/].
19 """This module contains classes that represent Telegram errors.
20 
21 .. versionchanged:: 20.0
22     Replaced ``Unauthorized`` by :class:`Forbidden`.
23 """
24 
25 __all__ = (
26     "BadRequest",
27     "ChatMigrated",
28     "Conflict",
29     "Forbidden",
30     "InvalidToken",
31     "NetworkError",
32     "PassportDecryptionError",
33     "RetryAfter",
34     "TelegramError",
35     "TimedOut",
36 )
37 
38 from typing import Optional, Tuple, Union
39 
40 
41 def _lstrip_str(in_s: str, lstr: str) -> str:
42     """
43     Args:
44         in_s (:obj:`str`): in string
45         lstr (:obj:`str`): substr to strip from left side
46 
47     Returns:
48         :obj:`str`: The stripped string.
49 
50     """
51     return in_s[len(lstr) :] if in_s.startswith(lstr) else in_s
52 
53 
54 class TelegramError(Exception):
55     """
56     Base class for Telegram errors.
57 
58     Tip:
59         Objects of this type can be serialized via Python's :mod:`pickle` module and pickled
60         objects from one version of PTB are usually loadable in future versions. However, we can
61         not guarantee that this compatibility will always be provided. At least a manual one-time
62         conversion of the data may be needed on major updates of the library.
63 
64     .. seealso:: :wiki:`Exceptions, Warnings and Logging <Exceptions%2C-Warnings-and-Logging>`
65     """
66 
67     __slots__ = ("message",)
68 
69     def __init__(self, message: str):
70         super().__init__()
71 
72         msg = _lstrip_str(message, "Error: ")
73         msg = _lstrip_str(msg, "[Error]: ")
74         msg = _lstrip_str(msg, "Bad Request: ")
75         if msg != message:
76             # api_error - capitalize the msg...
77             msg = msg.capitalize()
78         self.message: str = msg
79 
80     def __str__(self) -> str:
81         return self.message
82 
83     def __repr__(self) -> str:
84         return f"{self.__class__.__name__}('{self.message}')"
85 
86     def __reduce__(self) -> Tuple[type, Tuple[str]]:
87         return self.__class__, (self.message,)
88 
89 
90 class Forbidden(TelegramError):
91     """Raised when the bot has not enough rights to perform the requested action.
92 
93     Examples:
94         :any:`Raw API Bot <examples.rawapibot>`
95 
96     .. versionchanged:: 20.0
97         This class was previously named ``Unauthorized``.
98     """
99 
100     __slots__ = ()
101 
102 
103 class InvalidToken(TelegramError):
104     """Raised when the token is invalid.
105 
106     Args:
107         message (:obj:`str`, optional): Any additional information about the exception.
108 
109             .. versionadded:: 20.0
110     """
111 
112     __slots__ = ()
113 
114     def __init__(self, message: Optional[str] = None) -> None:
115         super().__init__("Invalid token" if message is None else message)
116 
117 
118 class NetworkError(TelegramError):
119     """Base class for exceptions due to networking errors.
120 
121     Examples:
122         :any:`Raw API Bot <examples.rawapibot>`
123     """
124 
125     __slots__ = ()
126 
127 
128 class BadRequest(NetworkError):
129     """Raised when Telegram could not process the request correctly."""
130 
131     __slots__ = ()
132 
133 
134 class TimedOut(NetworkError):
135     """Raised when a request took too long to finish.
136 
137     Args:
138         message (:obj:`str`, optional): Any additional information about the exception.
139 
140             .. versionadded:: 20.0
141     """
142 
143     __slots__ = ()
144 
145     def __init__(self, message: Optional[str] = None) -> None:
146         super().__init__(message or "Timed out")
147 
148 
149 class ChatMigrated(TelegramError):
150     """
151     Raised when the requested group chat migrated to supergroup and has a new chat id.
152 
153     .. seealso::
154         :wiki:`Storing Bot, User and Chat Related Data <Storing-bot%2C-user-and-chat-related-data>`
155 
156     Args:
157         new_chat_id (:obj:`int`): The new chat id of the group.
158 
159     Attributes:
160         new_chat_id (:obj:`int`): The new chat id of the group.
161 
162     """
163 
164     __slots__ = ("new_chat_id",)
165 
166     def __init__(self, new_chat_id: int):
167         super().__init__(f"Group migrated to supergroup. New chat id: {new_chat_id}")
168         self.new_chat_id: int = new_chat_id
169 
170     def __reduce__(self) -> Tuple[type, Tuple[int]]:  # type: ignore[override]
171         return self.__class__, (self.new_chat_id,)
172 
173 
174 class RetryAfter(TelegramError):
175     """
176     Raised when flood limits where exceeded.
177 
178     .. versionchanged:: 20.0
179        :attr:`retry_after` is now an integer to comply with the Bot API.
180 
181     Args:
182         retry_after (:obj:`int`): Time in seconds, after which the bot can retry the request.
183 
184     Attributes:
185         retry_after (:obj:`int`): Time in seconds, after which the bot can retry the request.
186 
187     """
188 
189     __slots__ = ("retry_after",)
190 
191     def __init__(self, retry_after: int):
192         super().__init__(f"Flood control exceeded. Retry in {retry_after} seconds")
193         self.retry_after: int = retry_after
194 
195     def __reduce__(self) -> Tuple[type, Tuple[float]]:  # type: ignore[override]
196         return self.__class__, (self.retry_after,)
197 
198 
199 class Conflict(TelegramError):
200     """Raised when a long poll or webhook conflicts with another one."""
201 
202     __slots__ = ()
203 
204     def __reduce__(self) -> Tuple[type, Tuple[str]]:
205         return self.__class__, (self.message,)
206 
207 
208 class PassportDecryptionError(TelegramError):
209     """Something went wrong with decryption.
210 
211     .. versionchanged:: 20.0
212         This class was previously named ``TelegramDecryptionError`` and was available via
213         ``telegram.TelegramDecryptionError``.
214     """
215 
216     __slots__ = ("_msg",)
217 
218     def __init__(self, message: Union[str, Exception]):
219         super().__init__(f"PassportDecryptionError: {message}")
220         self._msg = str(message)
221 
222     def __reduce__(self) -> Tuple[type, Tuple[str]]:
223         return self.__class__, (self._msg,)
224
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/telegram/error.py b/telegram/error.py
--- a/telegram/error.py
+++ b/telegram/error.py
@@ -118,6 +118,13 @@
 class NetworkError(TelegramError):
     """Base class for exceptions due to networking errors.
 
+    Tip:
+        This exception (and its subclasses) usually originates from the networking backend
+        used by :class:`~telegram.request.HTTPXRequest`, or a custom implementation of
+        :class:`~telegram.request.BaseRequest`. In this case, the original exception can be
+        accessed via the ``__cause__``
+        `attribute <https://docs.python.org/3/library/exceptions.html#exception-context>`_.
+
     Examples:
         :any:`Raw API Bot <examples.rawapibot>`
     """

{"golden_diff": "diff --git a/telegram/error.py b/telegram/error.py\n--- a/telegram/error.py\n+++ b/telegram/error.py\n@@ -118,6 +118,13 @@\n class NetworkError(TelegramError):\n     \"\"\"Base class for exceptions due to networking errors.\n \n+    Tip:\n+        This exception (and its subclasses) usually originates from the networking backend\n+        used by :class:`~telegram.request.HTTPXRequest`, or a custom implementation of\n+        :class:`~telegram.request.BaseRequest`. In this case, the original exception can be\n+        accessed via the ``__cause__``\n+        `attribute <https://docs.python.org/3/library/exceptions.html#exception-context>`_.\n+\n     Examples:\n         :any:`Raw API Bot <examples.rawapibot>`\n     \"\"\"\n", "issue": "[FEATURE] More fine grained network exceptions\n### What kind of feature are you missing? Where do you notice a shortcoming of PTB?\n\nWe currently only have `NetworkError` and `TimeoutError(NetworkError)` to indicate exceptions that are due to natworking problems (in contrast to exceptions issued by TG). This is not very fine grained and can make advanced exception handling difficult.\n\n### Describe the solution you'd like\n\nI'd like to add more subclasses. Looking it httpx, they have a [large number of them](https://github.com/encode/httpx/blob/2e2949c8ea88668f4cc5e509342b57e60fe4d86a/httpx/_exceptions.py#L1-L32). Not all of them add much value for us IMO. In the following I list all of the httpx excetpions and check the ones that I think would make sense to have for us:\r\n\r\n- [ ] HTTPError\r\n  - [ ] RequestError\r\n    - [ ] TransportError\r\n      - [x] TimeoutException ( (corresponds to `tg.TimeoutError`)\r\n        - [x] ConnectTimeout\r\n        - [x] ReadTimeout\r\n        - [x] WriteTimeout\r\n        - [x] PoolTimeout\r\n      - [x] NetworkError (corresponds to `tg.NetworkError`)\r\n        - [x] ConnectError\r\n        - [x] ReadError\r\n        - [x] WriteError\r\n        - [x] CloseError\r\n      - [ ] ProtocolError\r\n        - [ ] LocalProtocolError\r\n        - [ ] RemoteProtocolError\r\n      - [x] ProxyError\r\n      - [ ] UnsupportedProtocol\r\n    - [ ] DecodingError\r\n    - [ ] TooManyRedirects\r\n  - [ ] HTTPStatusError\r\n- [ ] InvalidURL\r\n- [ ] CookieConflict\r\n- [ ] StreamError\r\n  - [ ] StreamConsumed\r\n  - [ ] StreamClosed\r\n  - [ ] ResponseNotRead\r\n  - [ ] RequestNotRead\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n_No response_\n", "before_files": [{"content": "#!/usr/bin/env python\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2023\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Lesser Public License for more details.\n#\n# You should have received a copy of the GNU Lesser Public License\n# along with this program.  If not, see [http://www.gnu.org/licenses/].\n\"\"\"This module contains classes that represent Telegram errors.\n\n.. versionchanged:: 20.0\n    Replaced ``Unauthorized`` by :class:`Forbidden`.\n\"\"\"\n\n__all__ = (\n    \"BadRequest\",\n    \"ChatMigrated\",\n    \"Conflict\",\n    \"Forbidden\",\n    \"InvalidToken\",\n    \"NetworkError\",\n    \"PassportDecryptionError\",\n    \"RetryAfter\",\n    \"TelegramError\",\n    \"TimedOut\",\n)\n\nfrom typing import Optional, Tuple, Union\n\n\ndef _lstrip_str(in_s: str, lstr: str) -> str:\n    \"\"\"\n    Args:\n        in_s (:obj:`str`): in string\n        lstr (:obj:`str`): substr to strip from left side\n\n    Returns:\n        :obj:`str`: The stripped string.\n\n    \"\"\"\n    return in_s[len(lstr) :] if in_s.startswith(lstr) else in_s\n\n\nclass TelegramError(Exception):\n    \"\"\"\n    Base class for Telegram errors.\n\n    Tip:\n        Objects of this type can be serialized via Python's :mod:`pickle` module and pickled\n        objects from one version of PTB are usually loadable in future versions. However, we can\n        not guarantee that this compatibility will always be provided. At least a manual one-time\n        conversion of the data may be needed on major updates of the library.\n\n    .. seealso:: :wiki:`Exceptions, Warnings and Logging <Exceptions%2C-Warnings-and-Logging>`\n    \"\"\"\n\n    __slots__ = (\"message\",)\n\n    def __init__(self, message: str):\n        super().__init__()\n\n        msg = _lstrip_str(message, \"Error: \")\n        msg = _lstrip_str(msg, \"[Error]: \")\n        msg = _lstrip_str(msg, \"Bad Request: \")\n        if msg != message:\n            # api_error - capitalize the msg...\n            msg = msg.capitalize()\n        self.message: str = msg\n\n    def __str__(self) -> str:\n        return self.message\n\n    def __repr__(self) -> str:\n        return f\"{self.__class__.__name__}('{self.message}')\"\n\n    def __reduce__(self) -> Tuple[type, Tuple[str]]:\n        return self.__class__, (self.message,)\n\n\nclass Forbidden(TelegramError):\n    \"\"\"Raised when the bot has not enough rights to perform the requested action.\n\n    Examples:\n        :any:`Raw API Bot <examples.rawapibot>`\n\n    .. versionchanged:: 20.0\n        This class was previously named ``Unauthorized``.\n    \"\"\"\n\n    __slots__ = ()\n\n\nclass InvalidToken(TelegramError):\n    \"\"\"Raised when the token is invalid.\n\n    Args:\n        message (:obj:`str`, optional): Any additional information about the exception.\n\n            .. versionadded:: 20.0\n    \"\"\"\n\n    __slots__ = ()\n\n    def __init__(self, message: Optional[str] = None) -> None:\n        super().__init__(\"Invalid token\" if message is None else message)\n\n\nclass NetworkError(TelegramError):\n    \"\"\"Base class for exceptions due to networking errors.\n\n    Examples:\n        :any:`Raw API Bot <examples.rawapibot>`\n    \"\"\"\n\n    __slots__ = ()\n\n\nclass BadRequest(NetworkError):\n    \"\"\"Raised when Telegram could not process the request correctly.\"\"\"\n\n    __slots__ = ()\n\n\nclass TimedOut(NetworkError):\n    \"\"\"Raised when a request took too long to finish.\n\n    Args:\n        message (:obj:`str`, optional): Any additional information about the exception.\n\n            .. versionadded:: 20.0\n    \"\"\"\n\n    __slots__ = ()\n\n    def __init__(self, message: Optional[str] = None) -> None:\n        super().__init__(message or \"Timed out\")\n\n\nclass ChatMigrated(TelegramError):\n    \"\"\"\n    Raised when the requested group chat migrated to supergroup and has a new chat id.\n\n    .. seealso::\n        :wiki:`Storing Bot, User and Chat Related Data <Storing-bot%2C-user-and-chat-related-data>`\n\n    Args:\n        new_chat_id (:obj:`int`): The new chat id of the group.\n\n    Attributes:\n        new_chat_id (:obj:`int`): The new chat id of the group.\n\n    \"\"\"\n\n    __slots__ = (\"new_chat_id\",)\n\n    def __init__(self, new_chat_id: int):\n        super().__init__(f\"Group migrated to supergroup. New chat id: {new_chat_id}\")\n        self.new_chat_id: int = new_chat_id\n\n    def __reduce__(self) -> Tuple[type, Tuple[int]]:  # type: ignore[override]\n        return self.__class__, (self.new_chat_id,)\n\n\nclass RetryAfter(TelegramError):\n    \"\"\"\n    Raised when flood limits where exceeded.\n\n    .. versionchanged:: 20.0\n       :attr:`retry_after` is now an integer to comply with the Bot API.\n\n    Args:\n        retry_after (:obj:`int`): Time in seconds, after which the bot can retry the request.\n\n    Attributes:\n        retry_after (:obj:`int`): Time in seconds, after which the bot can retry the request.\n\n    \"\"\"\n\n    __slots__ = (\"retry_after\",)\n\n    def __init__(self, retry_after: int):\n        super().__init__(f\"Flood control exceeded. Retry in {retry_after} seconds\")\n        self.retry_after: int = retry_after\n\n    def __reduce__(self) -> Tuple[type, Tuple[float]]:  # type: ignore[override]\n        return self.__class__, (self.retry_after,)\n\n\nclass Conflict(TelegramError):\n    \"\"\"Raised when a long poll or webhook conflicts with another one.\"\"\"\n\n    __slots__ = ()\n\n    def __reduce__(self) -> Tuple[type, Tuple[str]]:\n        return self.__class__, (self.message,)\n\n\nclass PassportDecryptionError(TelegramError):\n    \"\"\"Something went wrong with decryption.\n\n    .. versionchanged:: 20.0\n        This class was previously named ``TelegramDecryptionError`` and was available via\n        ``telegram.TelegramDecryptionError``.\n    \"\"\"\n\n    __slots__ = (\"_msg\",)\n\n    def __init__(self, message: Union[str, Exception]):\n        super().__init__(f\"PassportDecryptionError: {message}\")\n        self._msg = str(message)\n\n    def __reduce__(self) -> Tuple[type, Tuple[str]]:\n        return self.__class__, (self._msg,)\n", "path": "telegram/error.py"}], "after_files": [{"content": "#!/usr/bin/env python\n#\n# A library that provides a Python interface to the Telegram Bot API\n# Copyright (C) 2015-2023\n# Leandro Toledo de Souza <devs@python-telegram-bot.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Lesser Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Lesser Public License for more details.\n#\n# You should have received a copy of the GNU Lesser Public License\n# along with this program.  If not, see [http://www.gnu.org/licenses/].\n\"\"\"This module contains classes that represent Telegram errors.\n\n.. versionchanged:: 20.0\n    Replaced ``Unauthorized`` by :class:`Forbidden`.\n\"\"\"\n\n__all__ = (\n    \"BadRequest\",\n    \"ChatMigrated\",\n    \"Conflict\",\n    \"Forbidden\",\n    \"InvalidToken\",\n    \"NetworkError\",\n    \"PassportDecryptionError\",\n    \"RetryAfter\",\n    \"TelegramError\",\n    \"TimedOut\",\n)\n\nfrom typing import Optional, Tuple, Union\n\n\ndef _lstrip_str(in_s: str, lstr: str) -> str:\n    \"\"\"\n    Args:\n        in_s (:obj:`str`): in string\n        lstr (:obj:`str`): substr to strip from left side\n\n    Returns:\n        :obj:`str`: The stripped string.\n\n    \"\"\"\n    return in_s[len(lstr) :] if in_s.startswith(lstr) else in_s\n\n\nclass TelegramError(Exception):\n    \"\"\"\n    Base class for Telegram errors.\n\n    Tip:\n        Objects of this type can be serialized via Python's :mod:`pickle` module and pickled\n        objects from one version of PTB are usually loadable in future versions. However, we can\n        not guarantee that this compatibility will always be provided. At least a manual one-time\n        conversion of the data may be needed on major updates of the library.\n\n    .. seealso:: :wiki:`Exceptions, Warnings and Logging <Exceptions%2C-Warnings-and-Logging>`\n    \"\"\"\n\n    __slots__ = (\"message\",)\n\n    def __init__(self, message: str):\n        super().__init__()\n\n        msg = _lstrip_str(message, \"Error: \")\n        msg = _lstrip_str(msg, \"[Error]: \")\n        msg = _lstrip_str(msg, \"Bad Request: \")\n        if msg != message:\n            # api_error - capitalize the msg...\n            msg = msg.capitalize()\n        self.message: str = msg\n\n    def __str__(self) -> str:\n        return self.message\n\n    def __repr__(self) -> str:\n        return f\"{self.__class__.__name__}('{self.message}')\"\n\n    def __reduce__(self) -> Tuple[type, Tuple[str]]:\n        return self.__class__, (self.message,)\n\n\nclass Forbidden(TelegramError):\n    \"\"\"Raised when the bot has not enough rights to perform the requested action.\n\n    Examples:\n        :any:`Raw API Bot <examples.rawapibot>`\n\n    .. versionchanged:: 20.0\n        This class was previously named ``Unauthorized``.\n    \"\"\"\n\n    __slots__ = ()\n\n\nclass InvalidToken(TelegramError):\n    \"\"\"Raised when the token is invalid.\n\n    Args:\n        message (:obj:`str`, optional): Any additional information about the exception.\n\n            .. versionadded:: 20.0\n    \"\"\"\n\n    __slots__ = ()\n\n    def __init__(self, message: Optional[str] = None) -> None:\n        super().__init__(\"Invalid token\" if message is None else message)\n\n\nclass NetworkError(TelegramError):\n    \"\"\"Base class for exceptions due to networking errors.\n\n    Tip:\n        This exception (and its subclasses) usually originates from the networking backend\n        used by :class:`~telegram.request.HTTPXRequest`, or a custom implementation of\n        :class:`~telegram.request.BaseRequest`. In this case, the original exception can be\n        accessed via the ``__cause__``\n        `attribute <https://docs.python.org/3/library/exceptions.html#exception-context>`_.\n\n    Examples:\n        :any:`Raw API Bot <examples.rawapibot>`\n    \"\"\"\n\n    __slots__ = ()\n\n\nclass BadRequest(NetworkError):\n    \"\"\"Raised when Telegram could not process the request correctly.\"\"\"\n\n    __slots__ = ()\n\n\nclass TimedOut(NetworkError):\n    \"\"\"Raised when a request took too long to finish.\n\n    Args:\n        message (:obj:`str`, optional): Any additional information about the exception.\n\n            .. versionadded:: 20.0\n    \"\"\"\n\n    __slots__ = ()\n\n    def __init__(self, message: Optional[str] = None) -> None:\n        super().__init__(message or \"Timed out\")\n\n\nclass ChatMigrated(TelegramError):\n    \"\"\"\n    Raised when the requested group chat migrated to supergroup and has a new chat id.\n\n    .. seealso::\n        :wiki:`Storing Bot, User and Chat Related Data <Storing-bot%2C-user-and-chat-related-data>`\n\n    Args:\n        new_chat_id (:obj:`int`): The new chat id of the group.\n\n    Attributes:\n        new_chat_id (:obj:`int`): The new chat id of the group.\n\n    \"\"\"\n\n    __slots__ = (\"new_chat_id\",)\n\n    def __init__(self, new_chat_id: int):\n        super().__init__(f\"Group migrated to supergroup. New chat id: {new_chat_id}\")\n        self.new_chat_id: int = new_chat_id\n\n    def __reduce__(self) -> Tuple[type, Tuple[int]]:  # type: ignore[override]\n        return self.__class__, (self.new_chat_id,)\n\n\nclass RetryAfter(TelegramError):\n    \"\"\"\n    Raised when flood limits where exceeded.\n\n    .. versionchanged:: 20.0\n       :attr:`retry_after` is now an integer to comply with the Bot API.\n\n    Args:\n        retry_after (:obj:`int`): Time in seconds, after which the bot can retry the request.\n\n    Attributes:\n        retry_after (:obj:`int`): Time in seconds, after which the bot can retry the request.\n\n    \"\"\"\n\n    __slots__ = (\"retry_after\",)\n\n    def __init__(self, retry_after: int):\n        super().__init__(f\"Flood control exceeded. Retry in {retry_after} seconds\")\n        self.retry_after: int = retry_after\n\n    def __reduce__(self) -> Tuple[type, Tuple[float]]:  # type: ignore[override]\n        return self.__class__, (self.retry_after,)\n\n\nclass Conflict(TelegramError):\n    \"\"\"Raised when a long poll or webhook conflicts with another one.\"\"\"\n\n    __slots__ = ()\n\n    def __reduce__(self) -> Tuple[type, Tuple[str]]:\n        return self.__class__, (self.message,)\n\n\nclass PassportDecryptionError(TelegramError):\n    \"\"\"Something went wrong with decryption.\n\n    .. versionchanged:: 20.0\n        This class was previously named ``TelegramDecryptionError`` and was available via\n        ``telegram.TelegramDecryptionError``.\n    \"\"\"\n\n    __slots__ = (\"_msg\",)\n\n    def __init__(self, message: Union[str, Exception]):\n        super().__init__(f\"PassportDecryptionError: {message}\")\n        self._msg = str(message)\n\n    def __reduce__(self) -> Tuple[type, Tuple[str]]:\n        return self.__class__, (self._msg,)\n", "path": "telegram/error.py"}]}