This project is read-only.
1

Resolved

Feature Request: catch and throw new Exception in VMWareLib.VMWareVirtualMachine.RunProgramInGuest(...) to include relevant details

description

Hi.
 
I would like to request that VMWareLib.VMWareVirtualMachine.RunProgramInGuest(...) catch and throw a new Exception to include relevant details.
 
For example, notice that this exception doesn't contain the actual file path that was not found:
ERROR: A file was not found
Exception: Vestris.VMWareLib.VMWareException
at Vestris.VMWareLib.VMWareInterop.Check(UInt64 errCode) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareInterop.cs:line 25
at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareJob.cs:line 104
at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties, Int32 timeoutInSeconds) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareJob.cs:line 50
at Vestris.VMWareLib.VMWareVirtualMachine.RunProgramInGuest(String guestProgramName, String commandLineArgs, Int32 options, Int32 timeoutInSeconds) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareVirtualMachine.cs:line 793
at RemoteInstall.VMWareMappedVirtualMachine.RunProgramInGuest(String path, String parameters, Int32 options) in C:\codeplex\remoteinstall\trunk\RemoteInstall\VMWareMappedVirtualMachine.cs:line 139
at RemoteInstall.ExecuteDriver.Execute(CommandTaskConfig executeConfig) in C:\codeplex\remoteinstall\trunk\RemoteInstall\ExecuteDriver.cs:line 76
 
So I suggest that RunProgramInGuest catch and throw a new Exception(string.Format("Failed to Run Program In Guest: {0}\r\nCommand Line Arguments: {1}\r\nOptions: {2}\r\nTimeoutInSeconds: {3}", guestProgramName, commandLineArgs, options, timeoutInSeconds), ex) for example.
 
The same thing should be implemented for VMWareLib.VMWareVirtualMachine.CopyFileFromGuestToHost(...) for example
ERROR: A file was not found
Exception: Vestris.VMWareLib.VMWareException
at Vestris.VMWareLib.VMWareInterop.Check(UInt64 errCode) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareInterop.cs:line 25
at Vestris.VMWareLib.VMWareJob.Wait(Int32 timeoutInSeconds) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareJob.cs:line 37
at Vestris.VMWareLib.VMWareVirtualMachine.CopyFileFromGuestToHost(String guestPathName, String hostPathName, Int32 timeoutInSeconds) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareVirtualMachine.cs:line 609
at Vestris.VMWareLib.VMWareVirtualMachine.CopyFileFromGuestToHost(String guestPathName, String hostPathName) in C:\codeplex\vmwaretasks\trunk\Source\VMWareLib\VMWareVirtualMachine.cs:line 591
at RemoteInstall.VMWareMappedVirtualMachine.CopyFileFromGuestToHost(String guestPath, String hostPath) in C:\codeplex\remoteinstall\trunk\RemoteInstall\VMWareMappedVirtualMachine.cs:line 256
at RemoteInstall.CopyFilesDriver.CopyToTestClient(CopyFileConfig copyFileConfig, CopyFileResult copyFileResult) in C:\codeplex\remoteinstall\trunk\RemoteInstall\CopyFilesDriver.cs:line 159
at RemoteInstall.CopyFilesDriver.CopyFile(CopyFileConfig copyFileConfig) in C:\codeplex\remoteinstall\trunk\RemoteInstall\CopyFilesDriver.cs:line 59
 
Thank you.

comments

icnocop wrote Apr 14, 2011 at 10:49 PM

I've uploaded patch #9142.

wrote Apr 24, 2011 at 12:59 AM

wrote Feb 14, 2013 at 7:19 PM

wrote May 16, 2013 at 9:31 AM

wrote May 16, 2013 at 9:31 AM

wrote Jun 14, 2013 at 7:58 AM