<?php

declare(strict_types=1);

namespace External\HannahBundle\SAP\Exception;

class SAPErrorException extends SAPException
{
    private $sapErrorCode;

    private $sapErrorMessage;

    private array $sapOriginalMessage;

    public function __construct($message = '', $sapErrorCode = null, ?string $sapErrorMessage = null, array $sapOriginalMessage = [], ?\Throwable $previous = null)
    {
        $this->sapErrorCode = $sapErrorCode;
        $this->sapErrorMessage = $sapErrorMessage;
        $this->sapOriginalMessage = $sapOriginalMessage;

        parent::__construct($message, 0, $previous);
    }

    public function getSAPErrorCode()
    {
        return $this->sapErrorCode;
    }

    public function getSAPErrorMessage(): ?string
    {
        return $this->sapErrorMessage;
    }

    public function getSAPOriginalMessage(): array
    {
        return $this->sapOriginalMessage;
    }
}
