Errors#
Every error tidalpy raises derives from
TidalError, so one except clause catches
the whole family. The most useful distinctions:
AuthError— log in (or refresh) and retry.RateLimitError— transient; Tidal asked us to slow down (honoursRetry-After, waits are bounded).RegionLockedError— the catalogue exists but not in the account’s country.PreviewOnlyError— only a 30-second preview is available for this rendition.QualityUnavailableError— the requested quality is not licensed for this account/track.CancelledError— the host cancelled the operation (download runs return a report; streams raise).ConfigError— bad configuration; fix the config, retrying won’t help.
Structured exception hierarchy for tidalpy.
Every error carries a machine-readable to_dict() payload so hosts
(Django models, Celery task rows, logs) can persist failures without
parsing human-readable text. The legacy integration had to guess what
happened from CLI exit codes and stderr fragments; this hierarchy makes
the failure mode explicit and testable.
Error taxonomy#
ConfigErrorbad configuration, fail fast before network I/OAuthErrormissing/expired/unusable credentialsRateLimitErrorTIDAL kept answering 429 beyond the wait budgetNotFoundErrorresource id does not exist (either API version)RegionLockedErrorcontent unavailable in the account’s countryPreviewOnlyErroraccount can only hear 30 s previews (free tier)QualityUnavailableErrorno stream at any attempted tierStreamErrorplayback resolution failed for other reasonsManifestErrormanifest missing, corrupt, or DRM-protectedUnsupportedTyperesource kind this library does not handleDownloadErrornetwork/disk failure while fetching media bytesDiskFullErrorthe disk could not accept the media bytesCancelledErrorthe host cancelled the operation
- exception tidalpy.errors.AuthError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorCredentials are missing, expired, or unusable for this client.
- Parameters:
- Return type:
None
- exception tidalpy.errors.CancelledError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorThe host cancelled the in-flight operation.
- Parameters:
- Return type:
None
- exception tidalpy.errors.ConfigError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorConfiguration is missing or inconsistent.
- Parameters:
- Return type:
None
- exception tidalpy.errors.DiskFullError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
DownloadErrorThe destination disk ran out of space mid-download.
- Parameters:
- Return type:
None
- exception tidalpy.errors.DownloadError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorFetching the media bytes failed (network, truncation, disk).
- Parameters:
- Return type:
None
- exception tidalpy.errors.ManifestError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
StreamErrorA stream manifest is missing, corrupt, oversized, or DRM-protected.
- Parameters:
- Return type:
None
- exception tidalpy.errors.NotFoundError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorThe resource id does not exist (v1 and, when applicable, v2).
- Parameters:
- Return type:
None
- exception tidalpy.errors.PreviewOnlyError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorOnly a preview (e.g. free account) is offered for this content.
- Parameters:
- Return type:
None
Bases:
TidalErrorNo stream could be resolved at any attempted quality tier.
- Parameters:
- Return type:
None
- exception tidalpy.errors.RateLimitError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorTIDAL returned 429 repeatedly; the wait budget is exhausted.
- Parameters:
- Return type:
None
- exception tidalpy.errors.RegionLockedError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorThe content is not available in the account’s country.
- Parameters:
- Return type:
None
- exception tidalpy.errors.StreamError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorPlayback info / stream resolution failed for other reasons.
- Parameters:
- Return type:
None
- exception tidalpy.errors.TidalApiError(message, status_code=None, sub_status=None, codes=None, *details)[source]#
Bases:
TidalErrorA Tidal API rejection with HTTP/subStatus context attached.
- Parameters:
- Return type:
None
- exception tidalpy.errors.TidalError(message, *details, status_code=None, sub_status=None)[source]#
Bases:
ExceptionBase class for every error raised by tidalpy.
Every error carries a stable machine
code(e.g."auth-expired") that hosts may key off without string-matching the message, and aretryableflag:Truewhen the same call may succeed later without host action (transient network, rate limit),Falsefor permanent failures (bad token, region lock) where retrying wastes time.- Parameters:
- Return type:
None
- exception tidalpy.errors.UnsupportedType(message, *details, status_code=None, sub_status=None)[source]#
Bases:
TidalErrorThe resource kind is not handled (e.g. videos) or not requested.
- Parameters:
- Return type:
None