public CustomException(CustomExceptionType exceptionType, string userAlertMessage, string systemMessage, Exception ex) : base(userAlertMessage, ex) { ExceptionType = exceptionType; CustomExceptionDescription exceptionDetail = GetExceptionDetail(exceptionType); ExceptionPriority = exceptionDetail.Priority; if (userAlertMessage.IsNullOrEmpty()) { customExceptionUserDefinedMessage = exceptionDetail.DefaultErrorMessage; } else { customExceptionUserDefinedMessage = userAlertMessage; } if (systemMessage.IsNotNullOrEmpty()) { customExceptionSystemMessage = systemMessage; } else if (ex != null) { customExceptionSystemMessage = ex.Message; } else { customExceptionSystemMessage = customExceptionUserDefinedMessage; } }
public YdlCustomException(string message, string helpString = null, int errorCode = -1, CustomExceptionType exceptionType = CustomExceptionType.Unkonw) : base(message) { ErrorCode = errorCode; HelpString = helpString; ExceptionType = exceptionType; }
/// <summary> /// 构造函数 /// </summary> /// <param name="errorMsg">错误消息</param> /// <param name="errorCode">错误码</param> /// <param name="exceptionType">异常类型</param> public JsonResultEx(string errorMsg, int errorCode, CustomExceptionType exceptionType) { this.JsonRequestBehavior = JsonRequestBehavior.AllowGet; _errorInfo = new AjaxRequestErrorInfo { errorCode = errorCode, errorType = exceptionType, message = errorMsg }; _iserror = true; }
public CustomException(CustomExceptionType exceptionType) : base() { ExceptionType = exceptionType; CustomExceptionDescription exceptionDetail = GetExceptionDetail(exceptionType); if (exceptionDetail != null) { ExceptionPriority = exceptionDetail.Priority; customExceptionUserDefinedMessage = exceptionDetail.DefaultErrorMessage; customExceptionSystemMessage = customExceptionUserDefinedMessage; } }
private string CheckExceptionCode(byte[] recvBytes, out CustomExceptionType exCode) { exCode = CustomExceptionType.CET_OK; string errMsg = string.Empty; if (recvBytes.Length < 9) { } else { if (recvBytes[5] == 0x03 && recvBytes[6] == this.DevAddr) { switch (recvBytes[7]) { case 0x81: case 0x83: case 0x8f: case 0x90: switch (recvBytes[8]) { case 0x01: errMsg = "错误代码[0x01],错误的请求类型"; exCode = CustomExceptionType.CET_MB_WRONG_REQ_TYPE; break; case 0x02: errMsg = "错误代码[0x02],访问了非法地址"; exCode = CustomExceptionType.CET_MB_INVALID_ADDR; break; default: errMsg = "其他错误"; exCode = CustomExceptionType.CET_Unknown; break; } break; default: break; } } } return(errMsg); }
public CustomException(CustomExceptionType t, string message, System.Exception inner) : base(message, inner) { Init(); this.exceptionType = t; }
public CustomException(CustomExceptionType t, string message) : base(message) { Init(); this.exceptionType = t; }
public CustomException(CustomExceptionType t) : base() { Init(); this.exceptionType = t; }
private static LogEntry CreateEntry(string message, CustomExceptionType exceptionType, TraceEventType severity) { return new LogEntry(message, "General", 0, 100, severity, string.Empty, null); }
public CustomException(CustomExceptionType exceptionType, string userAlertMessage, Exception ex, Object source) : base(userAlertMessage, ex) { ExceptionType = exceptionType; CustomExceptionDescription exceptionDetail = GetExceptionDetail(exceptionType); ExceptionPriority = exceptionDetail.Priority; if (String.IsNullOrEmpty(userAlertMessage)) { _customExceptionUserDefinedMessage = exceptionDetail.DefaultErrorMessage; } else { _customExceptionUserDefinedMessage = userAlertMessage; } if (ex != null) { _customExceptionSystemMessage = ex.Message; } else { _customExceptionSystemMessage = _customExceptionUserDefinedMessage; } }
public CustomException(CustomExceptionType exceptionType) : base() { ExceptionType = exceptionType; CustomExceptionDescription exceptionDetail = GetExceptionDetail(exceptionType); if (exceptionDetail != null) { ExceptionPriority = exceptionDetail.Priority; _customExceptionUserDefinedMessage = exceptionDetail.DefaultErrorMessage; _customExceptionSystemMessage = _customExceptionUserDefinedMessage; } }
private LogEntry CreateEntry(string message, CustomExceptionType exceptionType, TraceEventType severity) { return(new LogEntry(message, "General", 0, 100, severity, string.Empty, null)); }
public CustomException(string message, Exception inner, CustomExceptionType type) : base(message, inner) { this.type = type; }
public CustomException(string message, CustomExceptionType type) : base(message) { this.type = type; }
public CustomException(CustomExceptionType exceptionType, string userAlertMessage,string systemMessage, Exception ex) : base(userAlertMessage,ex) { ExceptionType = exceptionType; CustomExceptionDescription exceptionDetail = GetExceptionDetail(exceptionType); ExceptionPriority = exceptionDetail.Priority; if (userAlertMessage.IsNullOrEmpty()) { customExceptionUserDefinedMessage = exceptionDetail.DefaultErrorMessage; } else { customExceptionUserDefinedMessage = userAlertMessage; } if (systemMessage.IsNotNullOrEmpty()) { customExceptionSystemMessage = systemMessage; } else if (ex!=null) { customExceptionSystemMessage = ex.Message; } else { customExceptionSystemMessage = customExceptionUserDefinedMessage; } }
public CustomException(string message, CustomExceptionType exCode) : base(message) { this.ExceptionCode = exCode; }