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 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); }
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 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); }
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 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; }
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 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; }