chore(): ws client tidying and misc improvements

This commit is contained in:
tiagosiebler
2025-01-24 12:44:01 +00:00
parent 9c12727b9d
commit ee23e13710
4 changed files with 166 additions and 265 deletions

View File

@@ -908,7 +908,11 @@ export abstract class BaseWebsocketClient<
/**
* Try sending a string event on a WS connection (identified by the WS Key)
*/
public tryWsSend(wsKey: TWSKey, wsMessage: string) {
public tryWsSend(
wsKey: TWSKey,
wsMessage: string,
throwExceptions?: boolean,
) {
try {
this.logger.trace('Sending upstream ws message: ', {
...WS_LOGGER_CATEGORY,
@@ -934,6 +938,9 @@ export abstract class BaseWebsocketClient<
wsKey,
exception: e,
});
if (throwExceptions) {
throw e;
}
}
}