Skip to content

Commit 2f803b7

Browse files
authored
Backend error on timeout (#63)
1 parent c6ad34e commit 2f803b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/youtubeaio/youtube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ async def _build_generator(
146146
_first = False
147147
except asyncio.TimeoutError as exc:
148148
msg = "Timeout occurred"
149-
raise YouTubeAPIError(msg) from exc
149+
raise YouTubeBackendError(msg) from exc
150150

151151
async def set_user_authentication(
152152
self,

tests/test_youtube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def response_handler(_: BaseRequest) -> Response:
5656
)
5757

5858
youtube = YouTube(session_timeout=1)
59-
with pytest.raises(YouTubeAPIError):
59+
with pytest.raises(YouTubeBackendError):
6060
assert await youtube.get_video(video_id="Ks-_Mh1QhMc")
6161
await youtube.close()
6262

0 commit comments

Comments
 (0)