mirror of
https://gitlab.com/RemixDev/deezer-py.git
synced 2025-01-01 12:26:06 +00:00
Added more infos to APIErrors
This commit is contained in:
parent
2b4fab5f19
commit
1834a87378
|
@ -4,7 +4,7 @@ from deezer.gw import GW
|
||||||
from deezer.api import API
|
from deezer.api import API
|
||||||
import json
|
import json
|
||||||
|
|
||||||
__version__ = "0.0.5"
|
__version__ = "0.0.6"
|
||||||
|
|
||||||
class TrackFormats():
|
class TrackFormats():
|
||||||
"""Number associtation for formats"""
|
"""Number associtation for formats"""
|
||||||
|
|
|
@ -39,14 +39,14 @@ class API:
|
||||||
if result_json['error']['code'] in [4, 700]:
|
if result_json['error']['code'] in [4, 700]:
|
||||||
eventlet.sleep(5)
|
eventlet.sleep(5)
|
||||||
return self.api_call(method, args)
|
return self.api_call(method, args)
|
||||||
if result_json['error']['code'] == 100: raise ItemsLimitExceededException
|
if result_json['error']['code'] == 100: raise ItemsLimitExceededException(f"ItemsLimitExceededException: {method}")
|
||||||
if result_json['error']['code'] == 200: raise PermissionException
|
if result_json['error']['code'] == 200: raise PermissionException(f"PermissionException: {method}")
|
||||||
if result_json['error']['code'] == 300: raise InvalidTokenException
|
if result_json['error']['code'] == 300: raise InvalidTokenException(f"InvalidTokenException: {method}")
|
||||||
if result_json['error']['code'] == 500: raise WrongParameterException
|
if result_json['error']['code'] == 500: raise WrongParameterException(f"ParameterException: {method}")
|
||||||
if result_json['error']['code'] == 501: raise MissingParameterException
|
if result_json['error']['code'] == 501: raise MissingParameterException(f"MissingParameterException: {method}")
|
||||||
if result_json['error']['code'] == 600: raise InvalidQueryException
|
if result_json['error']['code'] == 600: raise InvalidQueryException(f"InvalidQueryException: {method}")
|
||||||
if result_json['error']['code'] == 800: raise DataException
|
if result_json['error']['code'] == 800: raise DataException(f"DataException: {method}")
|
||||||
if result_json['error']['code'] == 901: raise IndividualAccountChangedNotAllowedException
|
if result_json['error']['code'] == 901: raise IndividualAccountChangedNotAllowedException(f"IndividualAccountChangedNotAllowedException: {method}")
|
||||||
raise APIError(json.dumps(result_json['error']))
|
raise APIError(json.dumps(result_json['error']))
|
||||||
return result_json
|
return result_json
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="deezer-py",
|
name="deezer-py",
|
||||||
version="0.0.5",
|
version="0.0.6",
|
||||||
description="A wrapper for all Deezer's APIs",
|
description="A wrapper for all Deezer's APIs",
|
||||||
long_description=README,
|
long_description=README,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|
Loading…
Reference in a new issue