namespace DocumentOperator.Domain.Common.Exceptions;

/// <summary>
/// Exception thrown when PDF processing operations fail.
/// Maps to HTTP 500 Internal Server Error or 422 Unprocessable Entity in the API layer.
/// </summary>
public class PdfProcessingException : DomainException
{
    public string Operation { get; }

    public PdfProcessingException(string operation, string message)
        : base($"PDF processing failed during '{operation}': {message}", "PDF_PROCESSING_ERROR")
    {
        Operation = operation;
    }

    public PdfProcessingException(string operation, string message, Exception innerException)
        : base($"PDF processing failed during '{operation}': {message}", "PDF_PROCESSING_ERROR", innerException)
    {
        Operation = operation;
    }

    public PdfProcessingException(string message)
        : base(message, "PDF_PROCESSING_ERROR")
    {
        Operation = "Unknown";
    }

    public PdfProcessingException(string message, Exception innerException)
        : base(message, "PDF_PROCESSING_ERROR", innerException)
    {
        Operation = "Unknown";
    }
}