title: Best practise to handle exceptions between actor and client in service fabric
body: <p>I am wondering what the best practise approach is to throwing/handling exceptions between Actors and clients within the service fabric. </p>
  
  <p>I noticed for example that when an exception was thrown from an Actor the client received a nested set of exceptions. The outer exception is of type System.AggregateException and merely indicates that "One or more errors occurred". But if you drill down to the actual inner exceptions, you see that the exception that was thrown from the Actor cannot be serialized.</p>
  
  <pre><code>    Test method PoCSystem.Test.CommandHandlerTest.CommandHandler_When_ExpectExceptionThrown threw exception: 
  System.AggregateException: One or more errors occurred. ---&gt; System.AggregateException: One or more errors occurred. ---&gt; 
  System.AggregateException: One or more errors occurred. ---&gt; System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: 
  Type 'PoCActor.Interfaces.ConcurrencyException' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  If the type is a collection, consider marking it with the CollectionDataContractAttribute.  See the Microsoft .NET Framework documentation for other supported types.
  </code></pre>
  
  <p>If you then mark the Exception with DataContract and DataMember attributes the Exception then complains that it is not compatible with serialization.</p>
  
  <p>What is the best approach for error handling in the service fabric?</p>