Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preExtendEvent callback errs param in dispatch func #79

Merged
merged 1 commit into from
Nov 20, 2018

Conversation

shazichuanshuo
Copy link
Contributor

@shazichuanshuo shazichuanshuo commented Nov 20, 2018

DESCRIPTION

The issue here is if there is error happened in the pre event extender, the callback will happen with param name err. However the code in the denormalizer dispatch func call it with [errs] which will cause ReferenceError.

STEPS

  1. Define an pre event extender as
module.exports = require('cqrs-eventdenormalizer').definePreEventExtender({
    name: 'testCreated',
    aggregate: 'test',
    context: 'core'
}, function(evt, col, callback) {
    callback(new Error('This is a test'), evt);;
});
  1. Call the denormalizer dispatch

EXPECTED

Handle the error gracefully

OBSERVATIONS

"ReferenceError: errs is not defined.

@adrai adrai merged commit 1031c5f into thenativeweb:master Nov 20, 2018
@adrai
Copy link
Contributor

adrai commented Nov 20, 2018

very nice, thx

@adrai
Copy link
Contributor

adrai commented Nov 20, 2018

v1.16.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants