<?php

namespace Modules\Invoices\SupplierInvoices\ImportStatements\Model;

class Exception extends \Exception
{
	/**
	 * Stores the exception message code (string) - to be converted into a string by using the $_LANG array.
	 * @var String
	 */
	protected $messageCode='';

	/**
	 * The constructor; it is rewritten so that the messageCode can be string.
	 * @param String $message
	 * @param Mixed $code
	 * @param \Exception $previous
	 */
	public function __construct($message = null, $code = 0, ?\Exception $previous = null) {
		$this->messageCode=$code;
		parent::__construct($message, 0, $previous);
	}

	/**
	 * Returns the message code set when the exception was thrown.
	 * @return String - the message code
	 */
	public function getMessageCode() {
		return $this->messageCode;
	}
}