示例#1
0
        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
            }
        }
示例#2
0
 public iQException(Exception innerException, string msg, string sysMessage, iQExceptionCode code, object[] args)
     : base(msg, innerException)
 {
     SysMessage = sysMessage;
     Code       = code;
     Args       = args;
 }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 /// <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)
 {
 }
示例#6
0
 /// <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)
 {
 }
示例#7
0
 /// <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)
 {
 }
示例#8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="method">Mensaje</param>
 public iQAuthorizationException(iQExceptionCode code)
     : this(string.Empty, string.Empty, code)
 {
 }
示例#9
0
 public iQInfoException(string message, string sysMessage = "", iQExceptionCode code = iQExceptionCode.INFO)
     : base(message, string.Empty, code)
 {
 }
示例#10
0
 public iQException(string msg, string sysMessage, iQExceptionCode code, object[] args)
     : this(null, msg, sysMessage, code, args)
 {
 }
示例#11
0
 /// <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)
 {
 }
示例#12
0
 /// <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)
 {
 }