Exemplo n.º 1
0
 private void requestGetErrors()
 {
     jQuery.ajax(new AjaxSettings {
         type = "GET",
         dataType = "json",
         url = jsUtils.inst.getLocation() + "/api/error",
         success = delegate(object o, JsString s, jqXHR arg3) {
             ngErrorModel res = o.As<ngErrorModel>();
             this.ngErrorModel = res;
             _scope.apply();
         }
     });
 }
Exemplo n.º 2
0
        public void LogError(Exception exception)
        {
            if (null != exception) {
                try {
                    ngErrorModel error = new ngErrorModel();
                    error.Date = DateTime.Now;
                    error.Error = exception.Message;
                    if (!string.IsNullOrEmpty(exception.StackTrace)) {
                        error.StackTrace = exception.StackTrace;
                    }
                    error.UserName = ApiUtils.GetLoggedInUser().Name;
                    try {
                        if (HttpContext.Current != null && HttpContext.Current.Request != null) {
                            error.Url = HttpContext.Current.Request.Url.ToString();
                        }
                    }
                    catch (Exception ex) {
                    }
                    List<ngErrorModel> errors = GetErrors();
                    errors.Add(error);

                    Save(errors);
                }
                catch (Exception e) {
                    Debug.Assert(false);
                }
            }
        }