<?php
namespace Fifa\ConnectServiceBus\Sdk\Exception;

use Fifa\ConnectServiceBus\Sdk\Api\ApiException;
use Fifa\ConnectServiceBus\Sdk\Message\Message;

/**
 * Class DecryptionException
 * @package Fifa\ConnectServiceBus\Sdk\Exception
 */
class DecryptionException extends CryptographyException
{
    /**
     * @var Message
     */
    private $serviceBusMessage;

    /**
     * Constructor
     *
     * @param Message $serviceBusMessage
     * @param ApiException $previous
     * @param string $message
     * @param int|null $code
     */
    public function __construct(Message $serviceBusMessage, ApiException $previous, $message = null, int $code = null)
    {
        parent::__construct($previous, $message, $code);
        $this->serviceBusMessage = $serviceBusMessage;
    }

    public function getServiceBusMessage(): Message
    {
        return $this->serviceBusMessage;
    }
}