RCVolus / league-prod-toolkit

Toolkit for League Productions with overlays for champion select, ingame events, end of game stats, and more
MIT License
131 stars 25 forks source link

add errorhandling for datadragon #79

Closed sdomi4 closed 2 years ago

sdomi4 commented 2 years ago

The toolkit hard crashes when datadragon/communitydragon is not available as is often the case around patch days. It should be possible to run the toolkit (if assets have been downloaded from a previous patch) without having to manually fix the game version in the config.

Crash message:

2022-03-01T21:31:30.354Z [info ] plugin-module-league-static: start downloading additional files

E:\tools\옵저버툴\league-prod-toolkit\modules\module-league-static\node_modules\node-fetch\lib\index.js:273
                                return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
                                                           ^
FetchError: invalid json response body at https://raw.communitydragon.org/12.5/game/global/items/items.bin.json reason: Unexpected token < in JSON at position 0
    at E:\tools\옵저버툴\league-prod-toolkit\modules\module-league-static\node_modules\node-fetch\lib\index.js:273:32
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async StaticData.getAdditionalFiles (E:\tools\옵저버툴\league-prod-toolkit\modules\module-league-static\dist\StaticData.js:197:25) {
  type: 'invalid-json'
}
Himyu commented 2 years ago

was fixed here https://github.com/rcv-prod-toolkit/module-league-static/commit/9c0e7009fd006b5f0bb3b256089b10fd4ec70932