fix(Tidal): 🐛 handle all exceptions during token login
* Updated exception handling in the `login` method to catch all exceptions instead of just `HTTPError` and `JSONDecodeError`. * This change ensures that any unexpected errors during the login process are handled gracefully, improving the robustness of the application.
This commit is contained in:
@@ -8,7 +8,6 @@ from threading import Event
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import tidalapi
|
import tidalapi
|
||||||
from requests import HTTPError
|
|
||||||
|
|
||||||
from tidal_dl_ng.helper.decorator import SingletonMeta
|
from tidal_dl_ng.helper.decorator import SingletonMeta
|
||||||
from tidal_dl_ng.helper.path import path_config_base, path_file_settings, path_file_token
|
from tidal_dl_ng.helper.path import path_config_base, path_file_settings, path_file_token
|
||||||
@@ -129,7 +128,7 @@ class Tidal(BaseConfig, metaclass=SingletonMeta):
|
|||||||
self.data.expiry_time,
|
self.data.expiry_time,
|
||||||
is_pkce=do_pkce,
|
is_pkce=do_pkce,
|
||||||
)
|
)
|
||||||
except (HTTPError, JSONDecodeError):
|
except Exception:
|
||||||
result = False
|
result = False
|
||||||
# Remove token file. Probably corrupt or invalid.
|
# Remove token file. Probably corrupt or invalid.
|
||||||
if os.path.exists(self.file_path):
|
if os.path.exists(self.file_path):
|
||||||
|
|||||||
Reference in New Issue
Block a user