Skip to content

Commit

Permalink
Ensure unexpected errors are also prefixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mdingena committed Apr 8, 2024
1 parent 3a01334 commit 734cf18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Subscriptions/Subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export class Subscriptions {
this.subscribe(subscription, key, callback) ??
Promise.reject(
new Error(
`[SUBSCRIPTIONS-${this.instanceId}] WebSocket recovery failed! Resubscribing to ${entry} was unsuccessful. Retrying recovery in ${this.client.config.webSocketRecoveryRetryDelay} ms.`
`WebSocket recovery failed! Resubscribing to ${entry} was unsuccessful. Retrying recovery in ${this.client.config.webSocketRecoveryRetryDelay} ms.`
)
)
);
Expand All @@ -424,7 +424,7 @@ export class Subscriptions {
setTimeout(() => {
reject(
new Error(
`[SUBSCRIPTIONS-${this.instanceId}] WebSocket recovery failed! Resubscribing was unsuccessful within ${this.client.config.webSocketRecoveryTimeout} ms. Retrying recovery in ${this.client.config.webSocketRecoveryRetryDelay} ms.`
`WebSocket recovery failed! Resubscribing was unsuccessful within ${this.client.config.webSocketRecoveryTimeout} ms. Retrying recovery in ${this.client.config.webSocketRecoveryRetryDelay} ms.`
)
);
}, this.client.config.webSocketRecoveryTimeout)
Expand All @@ -436,7 +436,7 @@ export class Subscriptions {
this.resolveHalted = resolve;
});

this.client.logger.error((error as Error).message);
this.client.logger.error(`[SUBSCRIPTIONS-${this.instanceId}] ${(error as Error).message}`);

await new Promise(resolve => setTimeout(resolve, this.client.config.webSocketRecoveryRetryDelay));

Expand Down

0 comments on commit 734cf18

Please sign in to comment.