You need to override the DomainService.OnError method, as described in this in the WCF RIA Services I / O block . I did this in the base DomainService class, and not in every single DomainService class in my application, as shown below. The errorInfo.Error property does not have a configuration tool, so I do not think that you can replace the exception object with your own, but the <system.web><customErrors mode="On" /> configuration element can prevent the details that are exposed to the client.
[EnableClientAccess()] public class DomainServiceBase : DomainService { protected override void OnError(DomainServiceErrorInfo errorInfo) { Logger.WriteException(errorInfo.Error); base.OnError(errorInfo); } }
source share