I'm trying to implement exception handling in a WCF service. I want this exception to be thrown to the client so it can be logged and handled.
I don't know if the code I've written is right or wrong. This only gets me "faultexception was unhandled by user code" How should i solve so i can handle my the exception in client?
Code in WCF-Service:
try
{
}
catch (FaultException fex)
{
throw fex;
}
catch (Exception ex)
{
throw ex;
}
Code in client:
try
{
}
catch (FaultException fex)
{
Logger.AddExceptionToDb(fex);
}
catch (Exception ex)
{
Logger.AddExceptionToDb(ex);
}