Update OnScheduler issues.

This commit is contained in:
robvde 2013-02-02 16:01:38 +04:00
parent 1297722c6a
commit b7ab52690e
4 changed files with 54 additions and 33 deletions

View file

@ -150,8 +150,8 @@ namespace WebsitePanel.EnterpriseServer
{
// ERROR
WriteLogRecord(2, ex.Message, ex.StackTrace);
return new Exception(String.Format("Error executing '{0}' task on '{1}' {2}",
TopTask.TaskName, TopTask.ItemName, TopTask.Source), ex);
return new Exception((TopTask != null) ? String.Format("Error executing '{0}' task on '{1}' {2}",
TopTask.TaskName, TopTask.ItemName, TopTask.Source) : String.Format("Error executing task"), ex);
}
public static void WriteError(Exception ex, string text, params string[] textParameters)
@ -182,12 +182,15 @@ namespace WebsitePanel.EnterpriseServer
logRecord.TextParameters = textParameters;
logRecord.TextIdent = TasksStack.Count - 1;
logRecord.ExceptionStackTrace = stackTrace;
RootTask.LogRecords.Add(logRecord);
RootTask.LastLogRecord = logRecord;
if (RootTask != null)
{
RootTask.LogRecords.Add(logRecord);
RootTask.LastLogRecord = logRecord;
// change entire task severity
if (severity > RootTask.Severity)
RootTask.Severity = severity;
// change entire task severity
if (severity > RootTask.Severity)
RootTask.Severity = severity;
}
}
public static void CompleteTask()