Skip to content

Commit

Permalink
Pass eventgate context to _processEvent for error event too
Browse files Browse the repository at this point in the history
This is needed in case any validate or produce functions
use the context, since they will be used for
error events as well.

Change-Id: Ibe633b59317e99a5dd2ba5586c22dbcd877b59ef
  • Loading branch information
ottomata committed Dec 11, 2019
1 parent d898a10 commit 4cd2eaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/eventgate.js
Expand Up @@ -175,7 +175,6 @@ class EventGate {
*/
async _processEvent(event, context = {}) {
this.log.trace({ event }, `Validating ${this.eventRepr(event)}...`);

try {
// validate() will validate event against the schema found at the
// schema URL returned by schemaUrlExtractor, and then return the event.
Expand Down Expand Up @@ -264,7 +263,8 @@ class EventGate {
`${failedResults.length} failed, producing ` +
`${errorEvents.length} error events.`
);
P.map(errorEvents, errorEvent => this._processEvent(errorEvent));
// Provide the event process context to _processEvent for error event too
P.map(errorEvents, errorEvent => this._processEvent(errorEvent, context));
},
0
);
Expand Down

0 comments on commit 4cd2eaa

Please sign in to comment.