You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
574 B
24 lines
574 B
using StabilityMatrix.Core.Exceptions; |
|
|
|
namespace StabilityMatrix.Core.Processes; |
|
|
|
public readonly record struct ProcessResult |
|
{ |
|
public required int ExitCode { get; init; } |
|
public string? StandardOutput { get; init; } |
|
public string? StandardError { get; init; } |
|
|
|
public string? ProcessName { get; init; } |
|
|
|
public TimeSpan Elapsed { get; init; } |
|
|
|
public bool IsSuccessExitCode => ExitCode == 0; |
|
|
|
public void EnsureSuccessExitCode() |
|
{ |
|
if (!IsSuccessExitCode) |
|
{ |
|
throw new ProcessException(this); |
|
} |
|
} |
|
}
|
|
|