コード例 #1
0
        public static void setError(System.Web.UI.Page page, System.Exception e)
        {
            System.Web.HttpContext context = new System.Web.HttpContext(page.Request, page.Response);
            context.ClearError();
            context.AddError(e);
            e = context.AllErrors[0];
            string msg = e.Message;

            try {
//				SoapException es;
//				if (e.GetType().Equals(typeof(SoapException))) {
//					es = (SoapException) e;
//					msg = ((XmlElement)es.Detail).GetElementsByTagName("messaggio")[0].FirstChild.Value;
//					//debug = ((XmlElement)es.Detail).GetElementsByTagName("debug")[0].FirstChild.Value;
//				}
            } catch (Exception) {}
            logger.Error(e);
            page.Session["ErrorManager.error"] = msg;
        }