namespace Inspectron.Epson;
///
/// Base exception for all Epson printer-related errors
///
public class EpsonPrinterException : Exception
{
public EpsonPrinterException() { }
public EpsonPrinterException(string message) : base(message) { }
public EpsonPrinterException(string message, Exception innerException) : base(message, innerException) { }
}
///
/// Exception thrown when connection to the printer fails or is lost
///
public class EpsonConnectionException : EpsonPrinterException
{
public string? PrinterIp { get; }
public int? PrinterPort { get; }
public EpsonConnectionException() { }
public EpsonConnectionException(string message) : base(message) { }
public EpsonConnectionException(string message, Exception innerException) : base(message, innerException) { }
public EpsonConnectionException(string message, string printerIp, int printerPort) : base(message)
{
PrinterIp = printerIp;
PrinterPort = printerPort;
}
public EpsonConnectionException(string message, string printerIp, int printerPort, Exception innerException)
: base(message, innerException)
{
PrinterIp = printerIp;
PrinterPort = printerPort;
}
}
///
/// Exception thrown when a command sent to the printer fails
///
public class EpsonCommandException : EpsonPrinterException
{
public byte[]? Command { get; }
public EpsonCommandException() { }
public EpsonCommandException(string message) : base(message) { }
public EpsonCommandException(string message, Exception innerException) : base(message, innerException) { }
public EpsonCommandException(string message, byte[] command) : base(message)
{
Command = command;
}
public EpsonCommandException(string message, byte[] command, Exception innerException)
: base(message, innerException)
{
Command = command;
}
}