diff --git a/src/ib-client.ts b/src/ib-client.ts index a21fd0e..d07e9f8 100644 --- a/src/ib-client.ts +++ b/src/ib-client.ts @@ -343,9 +343,9 @@ export class IBClient { this.isAuthenticated = false; this.stopTickle(); if (this.authAttempts >= this.maxAuthAttempts) { - throw new Error(`Failed to authenticate with IB Gateway after ${this.maxAuthAttempts} attempts`); + throw new Error(`Failed to authenticate with IB Gateway after ${this.maxAuthAttempts} attempts: ${isError(error) ? error.message : String(error)}`); } - throw new Error("Failed to authenticate with IB Gateway"); + throw error; } }