Skip to content

Commit 1149488

Browse files
author
Marc Ghorayeb
committed
fix(consumer): forward projection error to callback instead of throwing
1 parent 5421875 commit 1149488

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

consumer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Consumer.prototype.handleMessage = function (msg) {
4545

4646
Consumer.prototype.handleEvent = function (event, callback) {
4747
if (!event.type) throw new Error('Missing event type');
48-
if (!this.projections[event.type]) throw new Error('No projections for ' + event.type);
48+
if (!this.projections[event.type]) return callback(new Error('No projection found for ' + event.type));
4949
this.projections[event.type].bind(this)(event.data || event.args || {}, callback);
5050
};
5151

0 commit comments

Comments
 (0)