/// <summary>获取异常提示</summary>
        /// <param name="exception">异常</param>
        public static string GetPrompt(System.Exception exception)
        {
            if (exception == null)
            {
                return((string)null);
            }
            string exceptionPrompt = ExceptionPrompt.GetExceptionPrompt(exception);

            if (!string.IsNullOrWhiteSpace(exceptionPrompt))
            {
                return(exceptionPrompt);
            }
            Warning warning = exception as Warning;

            if (warning != null)
            {
                return(warning.Message);
            }
            if (Web.Environment.IsDevelopment() || ExceptionPrompt.IsShowSystemException)
            {
                return(exception.Message);
            }
            return("系统异常");
        }
Пример #2
0
 /// <summary>获取异常列表</summary>
 public IList <System.Exception> GetExceptions()
 {
     return(Warning.GetExceptions((System.Exception) this));
 }
Пример #3
0
 /// <summary>获取错误消息</summary>
 public string GetMessage()
 {
     return(Warning.GetMessage((System.Exception) this));
 }