I have a task running on a remote system connecting back to a server using WCF. It is very possible that the task can throw exceptions, and I'd like those exceptions to be channeled back to the server. Essentially I want to do something like this:
Client:
server.SendException(new UnauthorizedAccessException("Some Exception"));
Server:
public void SendException(Exception e)
{
throw e;
}
Contract:
[ServiceContract]
public interface IServerContract
{
[OperationContract]
void SendException(Exception e);
}
I've been reading a little bit about fault exceptions, but from what I understand, they are used for specific exceptions that are running in a method called over WCF. What I want is to send any type of exception that the application has thrown outside of WCF context, and then channel them back to the server for further processing. If it helps in a solution, the server also has a connection back to the client.