示例#1
0
 protected string FormatErrorMessage(ResourceManager resourceManager, CultureInfo cultureInfo, UserException ex)
 {
     if (ex is ValidationErrorsException)
     {
         return(FormatErrorMessage(resourceManager, cultureInfo, (ValidationErrorsException)ex));
     }
     return(FormatErrorMessage(resourceManager, cultureInfo, ex.GetType(), null, ex.GetErrorMessageParameters()));
 }
        /// <summary>
        /// Create.
        /// </summary>
        /// <param name="userException">The user exception containing the dispayed message.</param>
        public UserErrorModel(UserException userException)
        {
            if (userException == null)
            {
                throw new ArgumentNullException(nameof(userException));
            }

            this.DisplayMessage = userException.Message;
            this.ExceptionName  = userException.GetType().FullName;
        }
示例#3
0
 protected override string FormatErrorMessage(UserException ex)
 {
     return(FormatErrorMessage(Errors.ResourceManager, Errors.Culture, ex.GetType(), null, new object[] { _loginUrl.ToString(), _newPasswordUrl.ToString() }) ?? base.FormatErrorMessage(ex));
 }
示例#4
0
 protected string GetErrorCode(ResourceManager resourceManager, CultureInfo cultureInfo, UserException ex)
 {
     return(GetErrorCode(resourceManager, cultureInfo, ex.GetType()));
 }