Esempio n. 1
0
 public static void CheckForError(Task task, PswsCmdlet cmdlet)
 {
     ArgumentValidator.ThrowIfNull("task", task);
     ArgumentValidator.ThrowIfNull("cmdlet", cmdlet);
     if (!string.IsNullOrEmpty(cmdlet.Error))
     {
         string errMsg = cmdlet.Error.ToString();
         EOPRecipient.PublishErrorEvent(errMsg);
         string        text          = "<NULL>";
         Authenticator authenticator = cmdlet.Authenticator as Authenticator;
         if (authenticator != null)
         {
             text = text.ToString();
         }
         ExManagementApplicationLogger.LogEvent(ManagementEventLogConstants.Tuple_FfoReportingRecipientTaskFailure, new string[]
         {
             cmdlet.Organization ?? "<NULL>",
             cmdlet.HostServerName ?? "<NULL>",
             cmdlet.ToString() ?? "<NULL>",
             cmdlet.AdditionalHeaders.ToString() ?? "<NULL>",
             (cmdlet.RequestTimeout != null) ? cmdlet.RequestTimeout.Value.ToString() : "<NULL>",
             cmdlet.Exception.ToString() ?? "<NULL>"
         });
         task.WriteError(cmdlet.Exception, ErrorCategory.InvalidOperation, null);
     }
 }