To properly handle failed submit operations it is sometimes required to have access to the ChangeSet in order to see all errors and conflicts and it should therefore also be available through exceptions. Instead of trying to add everything to DomainOperationException and have a large class where several properties are only valid in certain circumstances I propose that a separate exception type with the additional properties available for failed submits is added .
Changes to DomainOperationException:
</br>* Add ValidationErrors property (valid for all types of operations, including Submits)
</br>* Make it unsealed
Add new exception SubmitOperationException (deriving from DomainOperationException)
</br>* Add ChangeSet property
</br>* Add EntitiesInError property
These changes are implemented in the async branch on my fork (http://openriaservices.codeplex.com/SourceControl/network/forks/danneesset/openriaservices?branch=async)
Since SubmitResult and LoadResult work much like SubmitOperation and LoadOperation but they don't expose any way of accessing error information (this is by design since a *Result always represents a successfully completed event) we need another way to access this information. I propose that the corresponding information is instead added to DomainOperationException.
The relevant properties are
* ValidationErrors (exist for LoadOperation, InvokeOperation today)
* EntitiesInError (exist for SubmitOperation)