You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is not awaited or called with .catch(...) after it, Node will exit if the promise returned by this._init() rejects.
It's a bit tricky because it is called in the constructor which means we can't just add await in front of it and I don't know enough about the codebase to suggest how to refactor it at the moment.
What i expected:
A failed API request should not make the process exit.
What actually happened:
A bad response when trying to refresh the token causes the process to exit
/Users/richardmiller/srv/ricky-js-monorepo/node_modules/axios/lib/core/settle.js:19
reject(new AxiosError(
^
AxiosError: Request failed with status code 503
at settle (/Users/richardmiller/srv/ricky-js-monorepo/node_modules/axios/lib/core/settle.js:19:12)
at Unzip.handleStreamEnd (/Users/richardmiller/srv/ricky-js-monorepo/node_modules/axios/lib/adapters/http.js:548:11)
at Unzip.emit (node:events:538:35)
at Unzip.emit (node:domain:475:12)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'ERR_BAD_RESPONSE',
(... removed unrelated stuff ...)
url: 'https://accounts.spotify.com/api/token',
params: {
grant_type: 'refresh_token',
code: undefined,
(... removed unrelated stuff ...)
To reproduce this bug:
Difficult to reproduce because it is caused by 503 from Spotify.
Node Version:
Library Version:
I have already checked issues regarding this bug.
This problem is generated due to version migration.
The text was updated successfully, but these errors were encountered:
You don't have to worry about the promise rejection in _init function there as the _init function involves a try catch statement. If there are any errors thrown, it is the SpotifyAPIError or the AxiosError. The package uses endpoints, resources for few endpoints are outdated as the spotify api has changed its few structures.
As i am the only one maintaining the module, it will take some time to fix this (probably more than a month). It would be better if you send the code which led to the error.
Bug Report
Since
spotify-api.js/src/Client.ts
Line 130 in 967f949
.catch(...)
after it, Node will exit if the promise returned bythis._init()
rejects.It's a bit tricky because it is called in the constructor which means we can't just add
await
in front of it and I don't know enough about the codebase to suggest how to refactor it at the moment.What i expected:
A failed API request should not make the process exit.
What actually happened:
A bad response when trying to refresh the token causes the process to exit
To reproduce this bug:
Difficult to reproduce because it is caused by 503 from Spotify.
Node Version:
Library Version:
I have already checked issues regarding this bug.
This problem is generated due to version migration.
The text was updated successfully, but these errors were encountered: