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
I noticed that as of version 4.0.0 I no longer receive an error message alerting that the access token has expired when a request is made with an expired access token (not using the newly implemented token refresh functionality).
Instead I receive two UnhandledPromiseRejectionWarnings:
My Code:
var YahooFantasy = require('yahoo-fantasy');
var yf = new YahooFantasy(
clientKey,
clientSecret,
);
yf.setUserToken(
accessToken
);
// Game
games = async () => {
try{
const data = await yf.user.games()
console.log(data)
} catch (err){
console.log(err)
}
}
games();
The error
(base) PS C:\Users\Liam\Desktop\Work\YahooAPI> node .\accessYahooAPI.js
TypeError: Cannot read property 'users' of undefined
at C:\Users\Liam\Desktop\Work\YahooAPI\node_modules\yahoo-fantasy\resources\userResource.mjs:19:43
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async games (C:\Users\Liam\Desktop\Work\YahooAPI\accessYahooAPI.js:69:18)
(node:8892) UnhandledPromiseRejectionWarning: #<Object>
(node:8892) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8892) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(base) PS C:\Users\Liam\Desktop\Work\YahooAPI>
I have run the following code to get more info:
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
// application specific logging, throwing an error, or other logic here
});
Hey @LudicrousLiam, catching up on all the issues while I'm here...
Can you verify this is still happening with 4.1.2? I'm happy to fix this but the hour wait while my token expires is a bit of a pain... I'll try to take a look tonight, but if you could confirm that would be great.
Hey,
I noticed that as of version 4.0.0 I no longer receive an error message alerting that the access token has expired when a request is made with an expired access token (not using the newly implemented token refresh functionality).
Instead I receive two UnhandledPromiseRejectionWarnings:
My Code:
The error
I have run the following code to get more info:
And receive this:
The text was updated successfully, but these errors were encountered: