internal static CimJobException CreateWithFullControl(CimJobContext jobContext, string message, string errorId, ErrorCategory errorCategory, Exception inner = null) { CimJobException cimJobException = new CimJobException(jobContext.PrependComputerNameToMessage(message), inner); cimJobException.InitializeErrorRecord(jobContext, errorId, errorCategory); return(cimJobException); }
/// <summary> /// Creates a <see cref="System.Management.Automation.Job"/> object that invokes a static method /// (of the class named by <see cref="Microsoft.PowerShell.Cmdletization.CmdletAdapter<TObjectInstance>.ClassName"/>) /// in the wrapped object model. /// </summary> /// <param name="session">Remote session to invoke the method in.</param> /// <param name="methodInvocationInfo">Method invocation details.</param> internal override StartableJob CreateStaticMethodInvocationJob(CimSession session, MethodInvocationInfo methodInvocationInfo) { TerminatingErrorTracker tracker = TerminatingErrorTracker.GetTracker(this.CmdletInvocationInfo, isStaticCmdlet: true); if (tracker.IsSessionTerminated(session)) { return(null); } if (!IsSupportedSession(session, tracker)) { return(null); } CimJobContext jobContext = this.CreateJobContext(session, targetObject: null); StartableJob result; if (methodInvocationInfo.MethodName.Equals(CimCmdletAdapter.CreateInstance_MethodName, StringComparison.OrdinalIgnoreCase)) { result = new CreateInstanceJob( jobContext, methodInvocationInfo); } else { result = new StaticMethodInvocationJob( jobContext, methodInvocationInfo); } return(result); }
internal EnumerateAssociatedInstancesJob(CimJobContext jobContext, CimQuery cimQuery, CimInstance associatedObject, string associationName, string resultRole, string sourceRole) : base(jobContext, cimQuery) { this.associatedObject = associatedObject; this.associationName = associationName; this.resultRole = resultRole; this.sourceRole = sourceRole; }
private void InitializeErrorRecordCore(CimJobContext jobContext, Exception exception, string errorId, ErrorCategory errorCategory) { object targetObject; Exception exception1 = exception; string str = errorId; ErrorCategory errorCategory1 = errorCategory; if (jobContext != null) { targetObject = jobContext.TargetObject; } else { targetObject = null; } ErrorRecord errorRecord = new ErrorRecord(exception1, str, errorCategory1, targetObject); if (jobContext == null) { this.errorRecord = errorRecord; return; } else { OriginInfo originInfo = new OriginInfo(jobContext.Session.ComputerName, Guid.Empty); this.errorRecord = new RemotingErrorRecord(errorRecord, originInfo); this.errorRecord.SetInvocationInfo(jobContext.CmdletInvocationInfo); this.errorRecord.PreserveInvocationInfoOnce = true; return; } }
internal QueryInstancesJob(CimJobContext jobContext, CimQuery cimQuery, string wqlCondition) : base(jobContext, cimQuery) { Dbg.Assert(wqlCondition != null, "Caller should verify that wqlCondition is not null"); var wqlQueryBuilder = new StringBuilder(); wqlQueryBuilder.Append("SELECT * FROM "); wqlQueryBuilder.Append(this.JobContext.ClassName); wqlQueryBuilder.Append(" "); wqlQueryBuilder.Append(wqlCondition); _wqlQuery = wqlQueryBuilder.ToString(); if (string.IsNullOrWhiteSpace(wqlCondition)) { _useEnumerateInstances = true; } else { if (jobContext.CmdletInvocationContext.CmdletDefinitionContext.UseEnumerateInstancesInsteadOfWql) { _useEnumerateInstances = true; } } }
private void InitializeErrorRecordCore(CimJobContext jobContext, Exception exception, string errorId, ErrorCategory errorCategory) { ErrorRecord coreErrorRecord = new ErrorRecord( exception: exception, errorId: errorId, errorCategory: errorCategory, targetObject: jobContext != null ? jobContext.TargetObject : null); if (jobContext != null) { System.Management.Automation.Remoting.OriginInfo originInfo = new System.Management.Automation.Remoting.OriginInfo( jobContext.Session.ComputerName, Guid.Empty); _errorRecord = new System.Management.Automation.Runspaces.RemotingErrorRecord( coreErrorRecord, originInfo); _errorRecord.SetInvocationInfo(jobContext.CmdletInvocationInfo); _errorRecord.PreserveInvocationInfoOnce = true; } else { _errorRecord = coreErrorRecord; } }
/// <summary> /// Creates a <see cref="System.Management.Automation.Job"/> object that performs a query against the wrapped object model. /// </summary> /// <param name="session">Remote session to query</param> /// <param name="baseQuery">Query parameters</param> /// <returns><see cref="System.Management.Automation.Job"/> object that performs a query against the wrapped object model</returns> internal override StartableJob CreateQueryJob(CimSession session, QueryBuilder baseQuery) { CimQuery query = baseQuery as CimQuery; if (query == null) { throw new ArgumentNullException("baseQuery"); } TerminatingErrorTracker tracker = TerminatingErrorTracker.GetTracker(this.CmdletInvocationInfo, isStaticCmdlet: false); if (tracker.IsSessionTerminated(session)) { return(null); } if (!IsSupportedSession(session, tracker)) { return(null); } CimJobContext jobContext = this.CreateJobContext(session, targetObject: null); StartableJob queryJob = query.GetQueryJob(jobContext); return(queryJob); }
internal MethodInvocationJobBase(CimJobContext jobContext, bool passThru, string methodSubject, MethodInvocationInfo methodInvocationInfo) : base(jobContext) { this._passThru = passThru; this._methodSubject = methodSubject; this._methodInvocationInfo = methodInvocationInfo; }
internal override StartableJob CreateStaticMethodInvocationJob(CimSession session, MethodInvocationInfo methodInvocationInfo) { StartableJob staticMethodInvocationJob; TerminatingErrorTracker tracker = TerminatingErrorTracker.GetTracker(this.CmdletInvocationInfo, true); if (!tracker.IsSessionTerminated(session)) { if (this.IsSupportedSession(session, tracker)) { CimJobContext cimJobContext = this.CreateJobContext(session, null); if (!methodInvocationInfo.MethodName.Equals("cim:CreateInstance", StringComparison.OrdinalIgnoreCase)) { staticMethodInvocationJob = new StaticMethodInvocationJob(cimJobContext, methodInvocationInfo); } else { staticMethodInvocationJob = new CreateInstanceJob(cimJobContext, methodInvocationInfo); } return(staticMethodInvocationJob); } else { return(null); } } else { return(null); } }
internal override StartableJob CreateQueryJob(CimSession session, QueryBuilder baseQuery) { CimQuery cimQuery = baseQuery as CimQuery; if (cimQuery != null) { TerminatingErrorTracker tracker = TerminatingErrorTracker.GetTracker(this.CmdletInvocationInfo, false); if (!tracker.IsSessionTerminated(session)) { if (this.IsSupportedSession(session, tracker)) { CimJobContext cimJobContext = this.CreateJobContext(session, null); StartableJob queryJob = cimQuery.GetQueryJob(cimJobContext); return(queryJob); } else { return(null); } } else { return(null); } } else { throw new ArgumentNullException("baseQuery"); } }
private void InitializeErrorRecord(CimJobContext jobContext, CimException cimException) { string cmdletizationClassName; CimJobException cimJobException = this; CimJobContext cimJobContext = jobContext; CimException cimException1 = cimException; string messageId = cimException.MessageId; string str = messageId; if (messageId == null) { str = string.Concat("MiClientApiError_", cimException.NativeErrorCode); } cimJobException.InitializeErrorRecordCore(cimJobContext, cimException1, str, CimJobException.ConvertCimExceptionToErrorCategory(cimException)); if (cimException.ErrorData != null) { this.errorRecord.CategoryInfo.TargetName = cimException.ErrorSource; ErrorCategoryInfo categoryInfo = this.errorRecord.CategoryInfo; if (jobContext != null) { cmdletizationClassName = jobContext.CmdletizationClassName; } else { cmdletizationClassName = null; } categoryInfo.TargetType = cmdletizationClassName; } }
private void InitializeErrorRecord(CimJobContext jobContext, string errorId, ErrorCategory errorCategory) { InitializeErrorRecordCore( jobContext: jobContext, exception: this, errorId: errorId, errorCategory: errorCategory); }
private static string GetCimNamespace(string cmdletizationClassName) { string str = null; string str1 = null; CimJobContext.ExtractCimNamespaceAndClassName(cmdletizationClassName, out str, out str1); return(str); }
internal PropertySettingJob(CimJobContext jobContext, bool passThru, CimInstance objectToModify, MethodInvocationInfo methodInvocationInfo) : base( jobContext, passThru, objectToModify.ToString(), methodInvocationInfo) { }
private static CimInstance GetEmptyInstance(CimJobContext jobContext) { Dbg.Assert(jobContext != null, "Caller should verify jobContext != null"); var result = new CimInstance(jobContext.ClassName, jobContext.Namespace); return(result); }
internal MethodInvocationJobBase(CimJobContext jobContext, bool passThru, string methodSubject, MethodInvocationInfo methodInvocationInfo) : base(jobContext) { Dbg.Assert(methodInvocationInfo != null, "Caller should verify methodInvocationInfo != null"); Dbg.Assert(methodSubject != null, "Caller should verify methodSubject != null"); _passThru = passThru; MethodSubject = methodSubject; _methodInvocationInfo = methodInvocationInfo; }
internal InstanceMethodInvocationJob(CimJobContext jobContext, bool passThru, CimInstance targetInstance, MethodInvocationInfo methodInvocationInfo) : base( jobContext, passThru, targetInstance.ToString(), methodInvocationInfo) { Dbg.Assert(targetInstance != null, "Caller should verify targetInstance != null"); _targetInstance = targetInstance; }
internal DeleteInstanceJob(CimJobContext jobContext, bool passThru, CimInstance objectToDelete, MethodInvocationInfo methodInvocationInfo) : base( jobContext, passThru, objectToDelete.ToString(), methodInvocationInfo) { Dbg.Assert(objectToDelete != null, "Caller should verify objectToDelete != null"); _objectToDelete = objectToDelete; }
internal StartableJob GetQueryJob(CimJobContext jobContext) { if (_associationName == null) { return(new QueryInstancesJob(jobContext, this, _wqlCondition.ToString())); } else { return(new EnumerateAssociatedInstancesJob(jobContext, this, _associatedObject, _associationName, _resultRole, _sourceRole)); } }
internal CimJobContext(CimCmdletInvocationContext cmdletInvocationContext, CimSession session, object targetObject) { this.CmdletInvocationContext = cmdletInvocationContext; this.Session = session; CimJobContext cimJobContext = this; object obj = targetObject; object className = obj; if (obj == null) { className = this.ClassName; } cimJobContext.TargetObject = className; }
private void InitializeErrorRecord(CimJobContext jobContext, CimException cimException) { InitializeErrorRecordCore( jobContext: jobContext, exception: cimException, errorId: cimException.MessageId ?? "MiClientApiError_" + cimException.NativeErrorCode, errorCategory: ConvertCimExceptionToErrorCategory(cimException)); if (cimException.ErrorData != null) { _errorRecord.CategoryInfo.TargetName = cimException.ErrorSource; _errorRecord.CategoryInfo.TargetType = jobContext != null ? jobContext.CmdletizationClassName : null; } }
internal static CimJobException CreateFromCimException( string jobDescription, CimJobContext jobContext, CimException cimException) { Dbg.Assert(!string.IsNullOrEmpty(jobDescription), "Caller should verify jobDescription != null"); Dbg.Assert(jobContext != null, "Caller should verify jobContext != null"); Dbg.Assert(cimException != null, "Caller should verify cimException != null"); string message = BuildErrorMessage(jobDescription, jobContext, cimException.Message); CimJobException cimJobException = new CimJobException(message, cimException); cimJobException.InitializeErrorRecord(jobContext, cimException); return(cimJobException); }
internal EnumerateAssociatedInstancesJob(CimJobContext jobContext, CimQuery cimQuery, CimInstance associatedObject, string associationName, string resultRole, string sourceRole) : base(jobContext, cimQuery) { _associatedObject = associatedObject; Dbg.Assert(_associatedObject != null, "Caller should verify that associatedObject is not null"); _associationName = associationName; Dbg.Assert(_associationName != null, "Caller should verify that associationName is not null"); _resultRole = resultRole; Dbg.Assert(_resultRole != null, "Caller should verify that resultRole is not null"); _sourceRole = sourceRole; Dbg.Assert(_sourceRole != null, "Caller should verify that sourceRole is not null"); }
private static string BuildErrorMessage(string jobDescription, CimJobContext jobContext, string errorMessage) { if (!string.IsNullOrEmpty(jobDescription)) { object[] objArray = new object[2]; objArray[0] = errorMessage; objArray[1] = jobDescription; string str = string.Format(CultureInfo.InvariantCulture, CmdletizationResources.CimJob_GenericCimFailure, objArray); return(jobContext.PrependComputerNameToMessage(str)); } else { return(jobContext.PrependComputerNameToMessage(errorMessage)); } }
private static string BuildErrorMessage(string jobDescription, CimJobContext jobContext, string errorMessage) { if (!string.IsNullOrEmpty(jobDescription)) { object[] objArray = new object[2]; objArray[0] = errorMessage; objArray[1] = jobDescription; string str = string.Format(CultureInfo.InvariantCulture, CmdletizationResources.CimJob_GenericCimFailure, objArray); return jobContext.PrependComputerNameToMessage(str); } else { return jobContext.PrependComputerNameToMessage(errorMessage); } }
internal CimChildJobBase(CimJobContext jobContext) : base(Job.GetCommandTextFromInvocationInfo(jobContext.CmdletInvocationInfo), " " /* temporary name - reset below */) { _jobContext = jobContext; this.PSJobTypeName = CIMJobType; this.Name = this.GetType().Name + _myJobNumber.ToString(CultureInfo.InvariantCulture); UsesResultsCollection = true; lock (s_globalRandom) { _random = new Random(s_globalRandom.Next()); } _jobSpecificCustomOptions = new Lazy <CimCustomOptionsDictionary>(this.CalculateJobSpecificCustomOptions); }
internal static CimJobException CreateWithFullControl( CimJobContext jobContext, string message, string errorId, ErrorCategory errorCategory, Exception inner = null) { Dbg.Assert(jobContext != null, "Caller should verify jobContext != null"); Dbg.Assert(!string.IsNullOrEmpty(message), "Caller should verify message != null"); Dbg.Assert(!string.IsNullOrEmpty(errorId), "Caller should verify errorId != null"); CimJobException cimJobException = new CimJobException(jobContext.PrependComputerNameToMessage(message), inner); cimJobException.InitializeErrorRecord(jobContext, errorId, errorCategory); return(cimJobException); }
/// <summary> /// Creates a <see cref="System.Management.Automation.Job"/> object that invokes an instance method in the wrapped object model. /// </summary> /// <param name="session">Remote session to invoke the method in.</param> /// <param name="objectInstance">The object on which to invoke the method.</param> /// <param name="methodInvocationInfo">Method invocation details.</param> /// <param name="passThru"><see langword="true"/> if successful method invocations should emit downstream the <paramref name="objectInstance"/> being operated on.</param> /// <returns></returns> internal override StartableJob CreateInstanceMethodInvocationJob(CimSession session, CimInstance objectInstance, MethodInvocationInfo methodInvocationInfo, bool passThru) { TerminatingErrorTracker tracker = TerminatingErrorTracker.GetTracker(this.CmdletInvocationInfo, isStaticCmdlet: false); if (tracker.IsSessionTerminated(session)) { return(null); } if (!IsSupportedSession(session, tracker)) { return(null); } CimJobContext jobContext = this.CreateJobContext(session, objectInstance); Dbg.Assert(objectInstance != null, "Caller should verify objectInstance != null"); StartableJob result; if (methodInvocationInfo.MethodName.Equals(CimCmdletAdapter.DeleteInstance_MethodName, StringComparison.OrdinalIgnoreCase)) { result = new DeleteInstanceJob( jobContext, passThru, objectInstance, methodInvocationInfo); } else if (methodInvocationInfo.MethodName.Equals(CimCmdletAdapter.ModifyInstance_MethodName, StringComparison.OrdinalIgnoreCase)) { result = new ModifyInstanceJob( jobContext, passThru, objectInstance, methodInvocationInfo); } else { result = new InstanceMethodInvocationJob( jobContext, passThru, objectInstance, methodInvocationInfo); } return(result); }
private static string BuildErrorMessage(string jobDescription, CimJobContext jobContext, string errorMessage) { Dbg.Assert(!string.IsNullOrEmpty(errorMessage), "Caller should verify !string.IsNullOrEmpty(errorMessage)"); if (string.IsNullOrEmpty(jobDescription)) { return(jobContext.PrependComputerNameToMessage(errorMessage)); } else { string errorMessageWithJobDescription = string.Format( CultureInfo.InvariantCulture, CmdletizationResources.CimJob_GenericCimFailure, errorMessage, jobDescription); return(jobContext.PrependComputerNameToMessage(errorMessageWithJobDescription)); } }
internal CimChildJobBase(CimJobContext jobContext) : base(Job.GetCommandTextFromInvocationInfo(jobContext.CmdletInvocationInfo), " ") { this._myJobNumber = Interlocked.Increment(ref CimChildJobBase <T> ._globalJobNumberCounter); this._sleepAndRetryDelayRangeMs = 0x3e8; this._cancellationTokenSource = new CancellationTokenSource(); this._jobStateLock = new object(); this._activityIdToLastProgressRecord = new ConcurrentDictionary <int, ProgressRecord>(); this._jobContext = jobContext; base.PSJobTypeName = "CimJob"; base.Name = string.Concat(base.GetType().Name, this._myJobNumber.ToString(CultureInfo.InvariantCulture)); base.UsesResultsCollection = true; lock (CimChildJobBase <T> .GlobalRandom) { this._random = new Random(CimChildJobBase <T> .GlobalRandom.Next()); } CimChildJobBase <T> cimChildJobBase = this; this._jobSpecificCustomOptions = new Lazy <CimCustomOptionsDictionary>(new Func <CimCustomOptionsDictionary>(cimChildJobBase.CalculateJobSpecificCustomOptions)); }
internal QueryInstancesJob(CimJobContext jobContext, CimQuery cimQuery, string wqlCondition) : base(jobContext, cimQuery) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("SELECT * FROM "); stringBuilder.Append(base.JobContext.ClassName); stringBuilder.Append(" "); stringBuilder.Append(wqlCondition); this._wqlQuery = stringBuilder.ToString(); if (!string.IsNullOrWhiteSpace(wqlCondition)) { if (jobContext.CmdletInvocationContext.CmdletDefinitionContext.UseEnumerateInstancesInsteadOfWql) { this._useEnumerateInstances = true; } return; } else { this._useEnumerateInstances = true; return; } }
internal InstanceMethodInvocationJob(CimJobContext jobContext, bool passThru, CimInstance targetInstance, MethodInvocationInfo methodInvocationInfo) : base(jobContext, passThru, targetInstance.ToString(), methodInvocationInfo) { this.targetInstance = targetInstance; }
private static string BuildErrorMessage(string jobDescription, CimJobContext jobContext, string errorMessage) { Dbg.Assert(!string.IsNullOrEmpty(errorMessage), "Caller should verify !string.IsNullOrEmpty(errorMessage)"); if (string.IsNullOrEmpty(jobDescription)) { return jobContext.PrependComputerNameToMessage(errorMessage); } else { string errorMessageWithJobDescription = string.Format( CultureInfo.InvariantCulture, CmdletizationResources.CimJob_GenericCimFailure, errorMessage, jobDescription); return jobContext.PrependComputerNameToMessage(errorMessageWithJobDescription); } }
internal static CimJobException CreateFromAnyException( string jobDescription, CimJobContext jobContext, Exception inner) { Dbg.Assert(!string.IsNullOrEmpty(jobDescription), "Caller should verify jobDescription != null"); Dbg.Assert(jobContext != null, "Caller should verify jobContext != null"); Dbg.Assert(inner != null, "Caller should verify inner != null"); CimException cimException = inner as CimException; if (cimException != null) { return CreateFromCimException(jobDescription, jobContext, cimException); } string message = BuildErrorMessage(jobDescription, jobContext, inner.Message); CimJobException cimJobException = new CimJobException(message, inner); var containsErrorRecord = inner as IContainsErrorRecord; if (containsErrorRecord != null) { cimJobException.InitializeErrorRecord( jobContext, errorId: "CimJob_" + containsErrorRecord.ErrorRecord.FullyQualifiedErrorId, errorCategory: containsErrorRecord.ErrorRecord.CategoryInfo.Category); } else { cimJobException.InitializeErrorRecord( jobContext, errorId: "CimJob_" + inner.GetType().Name, errorCategory: ErrorCategory.NotSpecified); } return cimJobException; }
internal static CimJobException CreateFromMethodErrorCode(string jobDescription, CimJobContext jobContext, string methodName, string errorCodeFromMethod) { string rawErrorMessage = string.Format( CultureInfo.InvariantCulture, CmdletizationResources.CimJob_ErrorCodeFromMethod, errorCodeFromMethod); string errorMessage = BuildErrorMessage(jobDescription, jobContext, rawErrorMessage); CimJobException cje = new CimJobException(errorMessage); cje.InitializeErrorRecord(jobContext, "CimJob_" + methodName + "_" + errorCodeFromMethod, ErrorCategory.InvalidResult); return cje; }
internal static CimJobException CreateWithFullControl(CimJobContext jobContext, string message, string errorId, ErrorCategory errorCategory, Exception inner = null) { CimJobException cimJobException = new CimJobException(jobContext.PrependComputerNameToMessage(message), inner); cimJobException.InitializeErrorRecord(jobContext, errorId, errorCategory); return cimJobException; }
internal static CimJobException CreateFromAnyException(string jobDescription, CimJobContext jobContext, Exception inner) { CimException cimException = inner as CimException; if (cimException == null) { string str = CimJobException.BuildErrorMessage(jobDescription, jobContext, inner.Message); CimJobException cimJobException = new CimJobException(str, inner); IContainsErrorRecord containsErrorRecord = inner as IContainsErrorRecord; if (containsErrorRecord == null) { cimJobException.InitializeErrorRecord(jobContext, string.Concat("CimJob_", inner.GetType().Name), ErrorCategory.NotSpecified); } else { cimJobException.InitializeErrorRecord(jobContext, string.Concat("CimJob_", containsErrorRecord.ErrorRecord.FullyQualifiedErrorId), containsErrorRecord.ErrorRecord.CategoryInfo.Category); } return cimJobException; } else { return CimJobException.CreateFromCimException(jobDescription, jobContext, cimException); } }
internal static CimJobException CreateFromMethodErrorCode(string jobDescription, CimJobContext jobContext, string methodName, string errorCodeFromMethod) { object[] objArray = new object[1]; objArray[0] = errorCodeFromMethod; string str = string.Format(CultureInfo.InvariantCulture, CmdletizationResources.CimJob_ErrorCodeFromMethod, objArray); string str1 = CimJobException.BuildErrorMessage(jobDescription, jobContext, str); CimJobException cimJobException = new CimJobException(str1); cimJobException.InitializeErrorRecord(jobContext, string.Concat("CimJob_", methodName, "_", errorCodeFromMethod), ErrorCategory.InvalidResult); return cimJobException; }
internal static CimJobException CreateWithFullControl( CimJobContext jobContext, string message, string errorId, ErrorCategory errorCategory, Exception inner = null) { Dbg.Assert(jobContext != null, "Caller should verify jobContext != null"); Dbg.Assert(!string.IsNullOrEmpty(message), "Caller should verify message != null"); Dbg.Assert(!string.IsNullOrEmpty(errorId), "Caller should verify errorId != null"); CimJobException cimJobException = new CimJobException(jobContext.PrependComputerNameToMessage(message), inner); cimJobException.InitializeErrorRecord(jobContext, errorId, errorCategory); return cimJobException; }
internal static CimJobException CreateFromCimException( string jobDescription, CimJobContext jobContext, CimException cimException) { Dbg.Assert(!string.IsNullOrEmpty(jobDescription), "Caller should verify jobDescription != null"); Dbg.Assert(jobContext != null, "Caller should verify jobContext != null"); Dbg.Assert(cimException != null, "Caller should verify cimException != null"); string message = BuildErrorMessage(jobDescription, jobContext, cimException.Message); CimJobException cimJobException = new CimJobException(message, cimException); cimJobException.InitializeErrorRecord(jobContext, cimException); return cimJobException; }
internal StaticMethodInvocationJob(CimJobContext jobContext, MethodInvocationInfo methodInvocationInfo) : base(jobContext, false, jobContext.CmdletizationClassName, methodInvocationInfo) { }
internal static CimJobException CreateFromCimException(string jobDescription, CimJobContext jobContext, CimException cimException) { string str = CimJobException.BuildErrorMessage(jobDescription, jobContext, cimException.Message); CimJobException cimJobException = new CimJobException(str, cimException); cimJobException.InitializeErrorRecord(jobContext, cimException); return cimJobException; }
private void InitializeErrorRecord(CimJobContext jobContext, string errorId, ErrorCategory errorCategory) { this.InitializeErrorRecordCore(jobContext, this, errorId, errorCategory); }