Skip to content

Commit

Permalink
Merge pull request #53 from ckcr4lyf/feature/retry-initial-get
Browse files Browse the repository at this point in the history
Handle axios error correctly
  • Loading branch information
ckcr4lyf authored Dec 24, 2024
2 parents 9956658 + 8693499 commit 95e7934
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/src/racing/add.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qbit-race",
"version": "2.0.0-alpha.17",
"version": "2.0.0-alpha.18",
"description": "Qbit utilities for racing",
"main": "./bin/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/racing/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const addTorrentToRace = async (api: QbittorrentApi, settings: Settings,
registeredFlag = true;
break;
} catch (e){
if (axios.isAxiosError(e) && e.status === 404){
if (axios.isAxiosError(e) && e.response?.status === 404){
logger.warn(`Got 404 from qbittorrent, probably not registered yet... Will sleep for a second and try again. (Error: ${e})`);
await sleep(1000);
continue;
Expand Down

0 comments on commit 95e7934

Please sign in to comment.