namespace Titano.Core.Packaging;
/// Why a TPK1 payload could not be read, written or extracted.
public enum PayloadError
{
/// The file carries no payload footer: not a packed installer, or its end was cut off.
NotFound,
/// Footer, manifest or entry data are inconsistent, truncated or fail their SHA-256.
Corrupt,
/// A path is absolute, escapes the target folder or uses a name Windows cannot store.
UnsafePath,
}
/// A payload problem with a machine-readable for exit codes and UI messages.
public sealed class PayloadException(PayloadError error, string message, Exception? innerException = null)
: Exception(message, innerException)
{
public PayloadError Error { get; } = error;
}