When the targetFilePath in cli.Wrap is not valid, an exception is fired which can't help in fixing the problem. #135
moh-hassan
started this conversation in
General
Replies: 2 comments 2 replies
-
It's true but, like mentioned in the linked issue, the underlying exception is very unspecific ( |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for reply.
but i can't catch this exception here is the code I used: try
{
var cmd = Cli.Wrap(invalid/path/file)
.WithArguments("-r xyz -u user1");
var r1 = await cmd.ExecuteBufferedAsync();
//...
}
catch (InvalidOperationException e) //not catched
{
Console.WriteLine($"InvalidOperationException {e}");
}
catch (System.ComponentModel.Win32Exception e) //only catched
{
Console.WriteLine($"Win32Exception {e}");
}
catch (Exception e)
{
Console.WriteLine($"Exception {e}");
} The only way to catch the replace the code at line 67
With the next code:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The next code contain invalid targetFilePath
CliWrapper fire an exception which can't help in fixing the problem.
It is nice if the error message is expressive and point to the invalid targetFilePath, something like:
I find a related issue [here] (#107)
Beta Was this translation helpful? Give feedback.
All reactions