<?php

namespace Fifa\ConnectId\Sdk\Tms;

use Exception;

class DeclarationRejectedException extends Exception
{
    private $reason;

    /**
     * @return string
     */
    public function getReason(): string
    {
        return $this->reason;
    }

    public function __construct($declarationType, $rejectionReason, $code = 0, Exception $previous = null)
    {
        parent::__construct(sprintf("%s was rejected. Reason: %s", $declarationType, $rejectionReason), $code, $previous);
        $this->reason = $rejectionReason;
    }
}