internal void WriteNonTerminatingError(string processName, int processId, object targetObject, Exception innerException, string resourceId, string errorId, ErrorCategory category) { object message; string str = resourceId; object[] objArray = new object[3]; objArray[0] = processName; objArray[1] = processId; object[] objArray1 = objArray; int num = 2; if (innerException == null) { message = ""; } else { message = innerException.Message; } objArray1[num] = message; string str1 = StringUtil.Format(str, objArray); ProcessCommandException processCommandException = new ProcessCommandException(str1, innerException); processCommandException.ProcessName = processName; base.WriteError(new ErrorRecord(processCommandException, errorId, category, targetObject)); }
/// <summary> /// Writes a non-terminating error. /// </summary> /// <param name="processName"></param> /// <param name="processId"></param> /// <param name="targetObject"></param> /// <param name="innerException"></param> /// <param name="resourceId"></param> /// <param name="errorId"></param> /// <param name="category"></param> internal void WriteNonTerminatingError( string processName, int processId, object targetObject, Exception innerException, string resourceId, string errorId, ErrorCategory category) { string message = StringUtil.Format(resourceId, processName, processId, (null == innerException) ? "" : innerException.Message); ProcessCommandException exception = new ProcessCommandException(message, innerException); exception.ProcessName = processName; WriteError(new ErrorRecord( exception, errorId, category, targetObject)); }