Beispiel #1
0
        // Token: 0x0600166B RID: 5739 RVA: 0x00054D24 File Offset: 0x00052F24
        private void ReportException(object sender, GenericEventArg <TaskErrorEventArg> e)
        {
            if (e.Data.ExceptionHandled)
            {
                return;
            }
            TaskLogger.LogError(e.Data.Exception);
            bool flag;

            if (this.context != null && this.context.ErrorInfo.Exception != null && !this.context.ErrorInfo.IsKnownError && TaskHelper.ShouldReportException(e.Data.Exception, out flag))
            {
                if (!flag)
                {
                    this.context.CommandShell.WriteWarning(Strings.UnhandledErrorMessage(e.Data.Exception.Message));
                }
                TaskLogger.SendWatsonReport(e.Data.Exception, this.context.InvocationInfo.CommandName, this.context.InvocationInfo.UserSpecifiedParameters);
            }
        }
 internal static void Execute(this ICriticalFeature feature, Action action, TaskContext taskContext, string methodNameInLog)
 {
     try
     {
         action();
     }
     catch (Exception ex)
     {
         Guid      uniqueId = taskContext.UniqueId;
         bool      flag     = false;
         Exception ex2;
         bool      needReportException = !TaskHelper.IsTaskKnownException(ex2) && TaskHelper.ShouldReportException(ex2, out flag);
         if (!needReportException)
         {
             CmdletLogger.SafeAppendGenericError(uniqueId, methodNameInLog, ex2.ToString(), false);
         }
         else
         {
             CmdletLogger.SafeAppendGenericError(uniqueId, methodNameInLog, ex2.ToString(), true);
             CmdletLogger.SafeSetLogger(uniqueId, RpsCmdletMetadata.ErrorType, "UnHandled");
         }
         if (feature == null || feature.IsCriticalException(ex2))
         {
             throw;
         }
         if (!flag)
         {
             taskContext.CommandShell.WriteWarning(Strings.WarningTaskModuleSkipped(methodNameInLog, ex2.Message));
         }
         Diagnostics.ReportException(ex2, Constants.CoreEventLogger, TaskEventLogConstants.Tuple_UnhandledException, (object ex) => needReportException, null, ExTraceGlobals.InstrumentationTracer, "Exception from  " + methodNameInLog + ": {0}");
     }
 }
Beispiel #3
0
        // Token: 0x060006F5 RID: 1781 RVA: 0x00019F08 File Offset: 0x00018108
        public static bool IsTaskUnhandledException(Exception exception)
        {
            bool flag;

            return(!TaskHelper.IsTaskKnownException(exception) && TaskHelper.ShouldReportException(exception, out flag));
        }