When using the Client.getTeamsAtWeek() function for league stats prior to 2018, the api fails with a 404.
(node:24828) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404
at createError (C:\scratch\GitHub\GentlemensLeague\node_modules\espn-fantasy-football-api\node-dev.js:1014:15)
at settle (C:\scratch\GitHub\GentlemensLeague\node_modules\espn-fantasy-football-api\node-dev.js:1289:12)
at IncomingMessage.handleStreamEnd (C:\scratch\GitHub\GentlemensLeague\node_modules\espn-fantasy-football-api\node-dev.js:361:11)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:24828) 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: 2)
(node:24828) [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.
I've found that I can get the relevent Teams map by utilizing the same endpoint as the getHistoricalScoreboardForWeek() api, As a result I've added getHistoricalTeamsAtWeek() to fulfill league history for years prior to 2018. I've confirmed that this has been able to pull information from my personal ESPN league which has data going back to the 2012 season.
When using the Client.getTeamsAtWeek() function for league stats prior to 2018, the api fails with a 404.
(node:24828) UnhandledPromiseRejectionWarning: Error: Request failed with status code 404 at createError (C:\scratch\GitHub\GentlemensLeague\node_modules\espn-fantasy-football-api\node-dev.js:1014:15) at settle (C:\scratch\GitHub\GentlemensLeague\node_modules\espn-fantasy-football-api\node-dev.js:1289:12) at IncomingMessage.handleStreamEnd (C:\scratch\GitHub\GentlemensLeague\node_modules\espn-fantasy-football-api\node-dev.js:361:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1220:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) (node:24828) 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: 2) (node:24828) [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.
I've found that I can get the relevent Teams map by utilizing the same endpoint as the getHistoricalScoreboardForWeek() api, As a result I've added getHistoricalTeamsAtWeek() to fulfill league history for years prior to 2018. I've confirmed that this has been able to pull information from my personal ESPN league which has data going back to the 2012 season.