ryan-mars / stochastic

TypeScript framework for building event-driven services. Easily go from Event Storming → Code.
MIT License
6 stars 1 forks source link

Command: CommandResponse should return errors too #41

Closed ryan-mars closed 3 years ago

ryan-mars commented 3 years ago

Epic: Command #8

sam-goodwin commented 3 years ago

Should Errors be top-level objects, like DomainEvent, where they all have a fully qualified name and some Shape?

ryan-mars commented 3 years ago

Should Errors be top-level objects, like DomainEvent, where they all have a fully qualified name and some Shape?

I don't see a need for Error to be a top level component, however CommandResponse should be a shape so it's easily serialized to JSON/schema. Error may need to be a Shape to facilitate this.

JSON Schema of course makes it easer for legacy/non-stochastic systems to integrate with Stochastic to issue commands and generate SDK's. As a principle anything exposed outside the bounded context should have its messages (sent or received) published as JSON Schema.