cofoundry icon indicating copy to clipboard operation
cofoundry copied to clipboard

DomainRepository: Patch: Better handling of nulls

Open HeyJoel opened this issue 1 year ago • 0 comments

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.

HeyJoel avatar Apr 21 '23 07:04 HeyJoel