Describe the bug
API endpoint are typed without reflecting potential errors. This is an issue since HTTPs errors (400+) do not reject promise but instead resolve them with an object not matching the type.
To Reproduce
Executing the following code will return an object not matching the type because TMDB send a 401 request with a descriptive error.
new TMDB('wrongApiToken').account.details()
Expected behavior
The previous code should either reject in case of error (ex: when the API token is unauthorized), or include the type error in the resolved type.
Desktop (please complete the following information):
Describe the bug API endpoint are typed without reflecting potential errors. This is an issue since HTTPs errors (400+) do not reject promise but instead resolve them with an object not matching the type.
To Reproduce Executing the following code will return an object not matching the type because TMDB send a 401 request with a descriptive error.
Expected behavior The previous code should either reject in case of error (ex: when the API token is unauthorized), or include the type error in the resolved type.
Desktop (please complete the following information):