public static void LogError(Exception ex, string contextualMessage, iQExceptionCode exCode = iQExceptionCode.NO_CODE) { try { // log error to Elmah if (contextualMessage != null) { // log exception with contextual information that's visible when // clicking on the error in the Elmah log var annotatedException = new Exception(contextualMessage, iQExceptionHandler.ConvertToiQException(ex, exCode)); ErrorSignal.FromCurrentContext().Raise(annotatedException, HttpContext.Current); } else { ErrorSignal.FromCurrentContext().Raise(iQExceptionHandler.ConvertToiQException(ex, exCode), HttpContext.Current); } // send errors to ErrorWS (my own legacy service) // using (ErrorWSSoapClient client = new ErrorWSSoapClient()) // { // client.LogErrors(...); // } } catch (Exception) { // uh oh! just keep going } }
public iQException(Exception innerException, string msg, string sysMessage, iQExceptionCode code, object[] args) : base(msg, innerException) { SysMessage = sysMessage; Code = code; Args = args; }
public static ErrorViewModel New(long httpCode, iQExceptionCode errorCode, string message, string systemMessage) { ErrorViewModel obj = new ErrorViewModel(); obj.HttpCode = httpCode; obj.molCode = errorCode; obj.Message = string.IsNullOrEmpty(message) ? GetMessage(httpCode) : message; obj.SystemMessage = systemMessage; obj.Title = GetTitle(httpCode); return(obj); }
public static iQException ConvertToiQException(Exception ex, iQExceptionCode exCode) { if (ex is iQException) { return((iQException)ex); } if (ex == null) { return(new iQException(string.Empty, exCode)); } iQException iQ_ex = GetiQException(ex); if (iQ_ex != null) { return(iQ_ex); } iQ_ex = new iQException(ex.Message); iQ_ex.Code = exCode; iQ_ex.SysMessage = GetAllMessages(ex); return(iQ_ex); }
/// <summary> /// Constructor /// </summary> /// <param name="msg">Mensaje</param> /// <param name="code">Mensaje del sistema</param> /// <param name="code">Código del mensaje</param> public iQPersistentException(string msg, string sysMessage, iQExceptionCode code) : base(msg, sysMessage, code) { }
/// <summary> /// Constructor /// </summary> /// <param name="msg">Mensaje</param> /// <param name="code">Código del mensaje</param> public iQPersistentException(string msg, iQExceptionCode code) : base(msg, code) { }
/// <summary> /// Constructor /// </summary> /// <param name="msg">Mensaje</param> /// <param name="sysMessage">Mensaje del sistema</param> public iQAuthorizationException(string msg, string sysMessage, iQExceptionCode code) : base(msg, sysMessage, code) { }
/// <summary> /// Constructor /// </summary> /// <param name="method">Mensaje</param> public iQAuthorizationException(iQExceptionCode code) : this(string.Empty, string.Empty, code) { }
public iQInfoException(string message, string sysMessage = "", iQExceptionCode code = iQExceptionCode.INFO) : base(message, string.Empty, code) { }
public iQException(string msg, string sysMessage, iQExceptionCode code, object[] args) : this(null, msg, sysMessage, code, args) { }
/// <summary> /// Constructor /// </summary> /// <param name="msg">Mensaje</param> /// <param name="code">Mensaje del sistema</param> /// <param name="code">Código del mensaje</param> public iQException(string msg, string sysMessage, iQExceptionCode code) : this(null, msg, sysMessage, code, null) { }
/// <summary> /// Constructor /// </summary> /// <param name="msg">Mensaje</param> /// <param name="code">Código del mensaje</param> public iQException(string msg, iQExceptionCode code) : this(null, msg, string.Empty, code, null) { }