Skip to content

Commit 29165da

Browse files
authored
Merge pull request #42 from code-rabi/fix-41-error-reporting
fix: preserve specific error messages during authentication
2 parents d8dee78 + 6c818d1 commit 29165da

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ib-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ export class IBClient {
343343
this.isAuthenticated = false;
344344
this.stopTickle();
345345
if (this.authAttempts >= this.maxAuthAttempts) {
346-
throw new Error(`Failed to authenticate with IB Gateway after ${this.maxAuthAttempts} attempts`);
346+
throw new Error(`Failed to authenticate with IB Gateway after ${this.maxAuthAttempts} attempts: ${isError(error) ? error.message : String(error)}`);
347347
}
348-
throw new Error("Failed to authenticate with IB Gateway");
348+
throw error;
349349
}
350350
}
351351

0 commit comments

Comments
 (0)