public void AddLog(BasePortalException objBasePortalException) { if (objBasePortalException.GetType().Name == "ModuleLoadException") { AddLog(objBasePortalException, ExceptionLogType.MODULE_LOAD_EXCEPTION); } else if (objBasePortalException.GetType().Name == "PageLoadException") { AddLog(objBasePortalException, ExceptionLogType.PAGE_LOAD_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SchedulerException") { AddLog(objBasePortalException, ExceptionLogType.SCHEDULER_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SecurityException") { AddLog(objBasePortalException, ExceptionLogType.SECURITY_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SearchException") { AddLog(objBasePortalException, ExceptionLogType.SEARCH_INDEXER_EXCEPTION); } else { AddLog(objBasePortalException, ExceptionLogType.GENERAL_EXCEPTION); } }
public void AddLog(BasePortalException objBasePortalException) { var log = new LogInfo { Exception = Exceptions.Exceptions.GetExceptionInfo(objBasePortalException), }; log.Exception.AssemblyVersion = objBasePortalException.AssemblyVersion; log.Exception.PortalId = objBasePortalException.PortalID; log.Exception.UserId = objBasePortalException.UserID; log.Exception.TabId = objBasePortalException.ActiveTabID; log.Exception.RawUrl = objBasePortalException.RawURL; log.Exception.Referrer = objBasePortalException.AbsoluteURLReferrer; log.Exception.UserAgent = objBasePortalException.UserAgent; if (objBasePortalException.GetType().Name == "ModuleLoadException") { AddLog(objBasePortalException, log, ExceptionLogType.MODULE_LOAD_EXCEPTION); } else if (objBasePortalException.GetType().Name == "PageLoadException") { AddLog(objBasePortalException, log, ExceptionLogType.PAGE_LOAD_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SchedulerException") { AddLog(objBasePortalException, log, ExceptionLogType.SCHEDULER_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SecurityException") { AddLog(objBasePortalException, log, ExceptionLogType.SECURITY_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SearchException") { AddLog(objBasePortalException, log, ExceptionLogType.SEARCH_INDEXER_EXCEPTION); } else { AddLog(objBasePortalException, log, ExceptionLogType.GENERAL_EXCEPTION); } }