Amss.Boilerplate.Api.Configuration.ApiContainerExtension.BusinessValidationExceptionHandler.HandleException C# (CSharp) Method

HandleException() public method

public HandleException ( Exception exception, System.Guid handlingInstanceId ) : Exception
exception System.Exception
handlingInstanceId System.Guid
return System.Exception
            public Exception HandleException(Exception exception, Guid handlingInstanceId)
            {
                var e = exception as BusinessValidationException;
                if (e != null)
                {
                    var list = from error in e.Errors ?? new ValidationFailureInfo[0]
                               select new ValidationFailure(
                                   error.PropertyName,
                                   error.ErrorMessage,
                                   error.ErrorCode,
                                   error.AttemptedValue);
                    exception = new ServiceStack.FluentValidation.ValidationException(list);
                }

                return exception;
            }
ApiContainerExtension.BusinessValidationExceptionHandler