Skip to content

Commit 3da95f7

Browse files
committed
Emit error when reconnection failed
1 parent 22c1356 commit 3da95f7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/module/rabbitmq.extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export class RabbitMQExt implements OnExtensionLoad, OnModuleInstantiated, OnShu
7878
.do(() => this.onModuleInstantiated(module, connection))
7979
.subscribe(() => {}, err => {
8080
errorHandler(err);
81+
const connectionError: any = new Error('@hapiness/rabbitmq Connection error');
82+
connectionError.source = err;
83+
connectionError.key = 'HAPINESS_RABBITMQ_CONNECTION_ERROR';
84+
connection.emit('error', connectionError);
8185
});
8286
});
8387

0 commit comments

Comments
 (0)