Esempio n. 1
0
        /// <summary>
        /// Log an exception in the Error table. Includes exception details and user environment.
        /// Optionally include user comments.
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <param name="ctx"></param>
        /// <param name="entities"></param>
        /// <param name="userComment"></param>
        /// <returns>ErrorID (string)</returns>
        public async static Task <string> WriteDebugInfoToErrorLog(string message, Exception ex, RequestDTO request, string userComment = "")
        {
            IErrorMgr emgr = new ErrorMgr(request);
            var       res  = await emgr.InsertError(ex, message, userComment);

            return(res.DbErrorId);
        }
Esempio n. 2
0
        public ActionResult IssueInfo(string comments)
        {
            if (HttpContext.Session == null)
            {
                return(View());
            }

            var eid = (HttpContext.Session != null && HttpContext.Session["ErrorID"] != null)
                ? HttpContext.Session["ErrorID"].ToString()
                : Request.Form["et"];

            //var emgr = new ErrorMgr(HttpContext.GetOwinContext().Get<WutNuContext>("WutNuContext"), HttpContext);

            var emgr = new ErrorMgr(Wutcontext, HttpContext);

            try
            {
                var eo = emgr.ReadError(eid);
                if (eo != null)
                {
                    eo.UserComment = comments;
                    emgr.SaveError(eo);
                }
                else
                {
                    //Writing to node WEL
                    emgr.WriteToAppLog("Unable to save user comments to. Comment: " + comments, System.Diagnostics.EventLogEntryType.Error);
                }
            }
            catch (Exception ex)
            {
                //Writing to node WEL
                emgr.WriteToAppLog("Unable to save user comments. \r\nError: " + ex.Message + ". \r\nComment: " + comments, System.Diagnostics.EventLogEntryType.Error);
            }

            return(View());
        }
Esempio n. 3
0
        public async Task <ActionResult> IssueInfo(string comments)
        {
            if (HttpContext.Session == null)
            {
                return(View());
            }

            var eid = (HttpContext.Session != null && HttpContext.Session["ErrorID"] != null)
                ? HttpContext.Session["ErrorID"].ToString()
                : Request.Form["et"];

            var emgr = new ErrorMgr(new RequestDTO(HttpContext));

            try
            {
                var eo = await emgr.ReadError(eid, false);

                if (eo != null)
                {
                    eo.UserComment = comments;
                    await emgr.SaveError(eo);
                }
                else
                {
                    //Writing to node WEL
                    emgr.WriteToAppLog("Unable to save user comments to. Comment: " + comments, System.Diagnostics.EventLogEntryType.Error);
                }
            }
            catch (Exception ex)
            {
                //Writing to node WEL
                emgr.WriteToAppLog("Unable to save user comments. \r\nError: " + ex.Message + ". \r\nComment: " + comments, System.Diagnostics.EventLogEntryType.Error);
            }

            return(View());
        }
Esempio n. 4
0
 public ConsoleMgr()
 {
     myError = new ErrorMgr(this);
 }