Skip to content

Commit 3ba8911

Browse files
authored
fix: log authenticaiton failed reasons (#882)
1 parent e82fc90 commit 3ba8911

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/services/qBittorrent/clientRequestManager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,25 @@ class ClientRequestManager {
8383
async updateConnection(connectionSettings?: QBittorrentConnectionSettings): Promise<void> {
8484
let failed = false;
8585

86-
this.authCookie = this.authenticate(connectionSettings).catch(() => {
87-
failed = true;
86+
this.authCookie = this.authenticate(connectionSettings).catch((reason) => {
87+
failed = reason;
8888
return undefined;
8989
});
9090

9191
this.apiVersion = this.authCookie
9292
.then(() => {
9393
return !failed ? this.getApiVersion() : Promise.resolve(undefined);
9494
})
95-
.catch(() => {
96-
failed = true;
95+
.catch((reason) => {
96+
failed = reason;
9797
return undefined;
9898
});
9999

100100
await this.authCookie;
101101
await this.apiVersion;
102102

103103
if (failed) {
104-
throw new Error();
104+
throw new Error(failed);
105105
}
106106
}
107107

0 commit comments

Comments
 (0)