Skip to content

Commit eb1c64e

Browse files
committed
change: add InvalidExitCodeException
1 parent c6806b1 commit eb1c64e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
3+
namespace Flucli.Exceptions;
4+
5+
/// <summary>
6+
/// Represents an exception that is thrown when an invalid exit code is returned by a process.
7+
/// </summary>
8+
public class InvalidExitCodeException : Exception
9+
{
10+
/// <summary>
11+
/// Initializes a new instance of <see cref="InvalidExitCodeException" />.
12+
/// </summary>
13+
/// <param name="validExitCodes">The valid exit codes for the process.</param>
14+
/// <param name="message">The message of the exception.</param>
15+
public InvalidExitCodeException(int[]? validExitCodes = null, string message = "Invalid ExitCode") : base(message)
16+
{
17+
ValidExitCodes = validExitCodes ?? [0];
18+
}
19+
20+
/// <summary>
21+
/// Gets the array containing all valid exit codes.
22+
/// </summary>
23+
public int[] ValidExitCodes { get; }
24+
}

0 commit comments

Comments
 (0)