You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment if you run await Cmd("nonexistent.exe").ExecuteAsync(); it will just throw the source System.ComponentModel.Win32Exception: The system cannot find the file specified.
That lacks the command name and that makes it harder to investigate the errors.
I wonder if CliWrap can intercept the error during process start and wrap it into exception with a better error message like CommandExecutionException
Thank you
The text was updated successfully, but these errors were encountered:
I looked into it and unfortunately Win32Exception is also thrown in a number of different cases besides non-existing file.
CommandExecutionException is also more focused on errors that happen when the process has already exited. Perhaps a different exception should be defined for these type of errors.
I'm leaning towards closing this as "won't fix" because it sounds like a bit too much effort for little gain. I'd recommend wrapping cmd.ExecuteAsync(...) in a try/catch and throwing a specialized exception yourself.
At the moment if you run
await Cmd("nonexistent.exe").ExecuteAsync();
it will just throw the sourceSystem.ComponentModel.Win32Exception: The system cannot find the file specified.
That lacks the command name and that makes it harder to investigate the errors.
I wonder if CliWrap can intercept the error during process start and wrap it into exception with a better error message like
CommandExecutionException
Thank you
The text was updated successfully, but these errors were encountered: