<?php

namespace App\Domain\Conversion\Domain\Exception;

use RuntimeException;

class ConversionException extends RuntimeException
{
    public static function fileNotFound(string $filePath): self
    {
        return new self(sprintf('File not found: %s', $filePath));
    }

    public static function invalidFileFormat(string $filename): self
    {
        return new self(sprintf('Invalid file format for: %s. Only CBR, CBZ, ZIP and RAR files are supported.', $filename));
    }

    public static function conversionFailed(string $reason): self
    {
        return new self(sprintf('Conversion failed: %s', $reason));
    }

    public static function fileSizeExceedsLimit(int $fileSize, int $maxSize): self
    {
        return new self(sprintf(
            'File size (%d bytes) exceeds the maximum limit of %d bytes',
            $fileSize,
            $maxSize
        ));
    }
}
