public void Execute(ManagerJob managerAgentJob) { try { // Passes on the log managerAgentJob.TextExtractorLog = TextExtractorLog; // catch and convert to custom exception try { managerAgentJob.Execute(); } catch (Exception exception) { ThrowAsTextExtractorException(exception); } } catch (CustomExceptions.TextExtractorException exception) { //Raise an update on the agents tab and event viewer TextExtractorLog.RaiseUpdate(exception.Message); GetNecessaryInformation(); AddToErrorQueue(exception, Constant.Tables.ManagerQueue); } }
public override void Execute() { // Relativity Access Helpers var sqlQueryHelper = new SqlQueryHelper(); var artifactQueries = new ArtifactQueries(); var eddsDbContext = Helper.GetDBContext(-1); var servicesMgr = Helper.GetServicesManager(); var errorLogModel = new ErrorLogModel(sqlQueryHelper, eddsDbContext, AgentID, Constant.Tables.ManagerQueue); var artifactFactory = new ArtifactFactory(artifactQueries, servicesMgr, errorLogModel); var agentManagerJob = new ManagerJob(sqlQueryHelper, artifactQueries, servicesMgr, eddsDbContext, artifactFactory, AgentID); var agentJobExceptionWrapper = new AgentJobExceptionWrapper(sqlQueryHelper, artifactQueries, servicesMgr, eddsDbContext, AgentID); agentJobExceptionWrapper.TextExtractorLog.OnUpdate += MessageRaised; agentJobExceptionWrapper.TextExtractorLog.OnError += ErrorRaised; agentJobExceptionWrapper.Execute(agentManagerJob); }