thenativeweb / node-cqrs-domain

Node-cqrs-domain is a node.js module based on nodeEventStore that. It can be very useful as domain component if you work with (d)ddd, cqrs, eventdenormalizer, host, etc.
http://cqrs.js.org/pages/domain.html
MIT License
269 stars 57 forks source link

Domain throws Error if sent command is missing command name #23

Closed xeronimus closed 9 years ago

xeronimus commented 9 years ago

Expected behavior: Domain triggers a "commandRejected" event (behaves similar to an ordinary failed command, e.g. validation, business rule, etc.)

Actual behavior: Domain throws an error: 'Please pass in a command name!'

The problem hereby is: the consumer of the cqrs-domain module has to handle these malformed commands specifically. (Differently to other malformed commands, where "only" some validation rule is violated)

@adrai I'm currently working on a fix for this issue

adrai commented 9 years ago

we discuss this tomorrow... I think a command without a name (or a command like "not a json") should really be an error and not a ValidationError ...like tcp packets that are not valid tcp packets... in theory they should be even ignored but I would prefer to throw an error... so the service can log it...