<?php

namespace App\Domain\Shared\Domain\Exception;

class JobNotRetryableException extends \DomainException
{
    public static function maxAttemptsReached(string $jobId, int $maxAttempts): self
    {
        return new self(sprintf('Job "%s" has reached its maximum number of attempts (%d)', $jobId, $maxAttempts));
    }

    public static function notFailed(string $jobId): self
    {
        return new self(sprintf('Cannot retry job "%s" because it is not in failed status', $jobId));
    }
}
