cofoundry
cofoundry copied to clipboard
DomainRepository: Patch: Better handling of nulls
See #536, better handling when an IPatchableCommand returns null
(entity not found). Copied from #536:
it's never good to get a
NullReferenceException
, and Cofoundry should be throwing a better error in this scenario where a patch command might not find the entity to update, perhaps a NotFoundException, or a validation exception? I'm not sure which is most appropriate without having a closer look, but I expect NotFoundException would be best becuse generally when executing a patch you are expecting the entity to exist.