forked from gitextensions/gitextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExternalOperationException.cs
52 lines (48 loc) · 1.9 KB
/
ExternalOperationException.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
namespace GitExtUtils
{
/// <summary>
/// Represents errors that occur during execution of an external operation,
/// e.g. running a git operation or launching an external process.
/// </summary>
public class ExternalOperationException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="ExternalOperationException"/> class with a specified parameters
/// and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="command">The command that led to the exception.</param>
/// <param name="arguments">The command arguments.</param>
/// <param name="workingDirectory">The working directory.</param>
/// <param name="exitCode">The exit code of an executed process.</param>
/// <param name="innerException">The exception that is the cause of the current exception.</param>
public ExternalOperationException(
string? command = null,
string? arguments = null,
string? workingDirectory = null,
int? exitCode = null,
Exception? innerException = null)
: base(innerException?.Message, innerException)
{
Command = command;
Arguments = arguments;
WorkingDirectory = workingDirectory;
ExitCode = exitCode;
}
/// <summary>
/// The command that led to the exception.
/// </summary>
public string? Command { get; }
/// <summary>
/// The command arguments.
/// </summary>
public string? Arguments { get; }
/// <summary>
/// The working directory.
/// </summary>
public string? WorkingDirectory { get; }
/// <summary>
/// The exit code of an executed process.
/// </summary>
public int? ExitCode { get; }
}
}