Amss.Boilerplate.Common.Exceptions.ExceptionHelper.TransformException C# (CSharp) Method

TransformException() public static method

public static TransformException ( this ex, string policyName ) : Exception
ex this
policyName string
return System.Exception
        public static Exception TransformException(this Exception ex, string policyName)
        {
            Contract.Assert(policyName != null);

            var exceptionToProcess = ex;
            if (ex != null)
            {
                Exception exceptionToThrow;
                var rethrow = ExceptionPolicy.HandleException(ex, policyName, out exceptionToThrow);
                if (rethrow && exceptionToThrow != null)
                {
                    exceptionToProcess = exceptionToThrow;
                }
            }

            return exceptionToProcess;
        }
ExceptionHelper