Skip to content

Commit

Permalink
feat: expose client error
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Sep 20, 2023
1 parent 65454fb commit f10786a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/simple-mq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export class SimpleMQBroker extends EventEmitter {
protected handleClient(client: Client) {
let id: string | undefined;
let session: MQClientSession | undefined;
client.on('error', (err) => {
this.emit('error', err);
});
client.on('close', () => {
if (id && session) {
delete this.clients[id!];
Expand Down

0 comments on commit f10786a

Please sign in to comment.