feat(v4.0.0-beta.5): BREAKING CHANGE: rename "error" event to "exception" to avoid unhandled exceptions

This commit is contained in:
tiagosiebler
2025-02-06 12:08:51 +00:00
parent a8f8d6bf15
commit 57b1a72b7f
10 changed files with 42 additions and 45 deletions

View File

@@ -136,7 +136,7 @@ export class WebsocketClient extends BaseWebsocketClient<
perWsKeyTopics[derivedWsKey] = [];
}
perWsKeyTopics[derivedWsKey].push(wsRequest);
perWsKeyTopics[derivedWsKey]!.push(wsRequest);
}
const promises: Promise<unknown>[] = [];
@@ -755,7 +755,7 @@ export class WebsocketClient extends BaseWebsocketClient<
}
results.push({
eventType: 'error',
eventType: 'exception',
event: parsed,
isWSAPIResponse: true,
});
@@ -804,7 +804,7 @@ export class WebsocketClient extends BaseWebsocketClient<
// Failed request
if (parsed.success === false) {
results.push({
eventType: 'error',
eventType: 'exception',
event: parsed,
});
return results;
@@ -851,7 +851,7 @@ export class WebsocketClient extends BaseWebsocketClient<
exception: e,
eventData: event.data,
},
eventType: 'error',
eventType: 'exception',
});
this.logger.error('Failed to parse event data due to exception: ', {