Skip to content

Stepp 11 Exception Handling

cdmdotnet edited this page Aug 11, 2015 · 1 revision

Exception Handling

Exceptions are not raised when processing a command.

That's golden rule number one. Instead of raising an exception, raise an event saying something specific happened. This is not a generic event, but a specific event. As an example, if an A.T.M. was built CQRS if you requested a withdraw of $1,000 from an account with only $200 in available funds you would raise an event such as "WithdrawFailedDueInsufficentFunds". Note that this isn't some generic event where you set a message property, this is a specific event.

Clone this wiki locally