Handle 404 error for tidal

This commit is contained in:
Nathan Thomas 2024-02-07 13:20:24 -08:00
parent 9d6a2be49e
commit 7da3e2436d
1 changed files with 4 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import time
import aiohttp
from ..config import Config
from ..exceptions import NonStreamableError
from .client import Client
from .downloadable import TidalDownloadable
@ -321,5 +322,8 @@ class TidalClient(Client):
async with self.rate_limiter:
async with self.session.get(f"{BASE}/{path}", params=params) as resp:
if resp.status == 404:
logger.warning("TIDAL: track not found", resp)
raise NonStreamableError("TIDAL: Track not found")
resp.raise_for_status()
return await resp.json()