2024-04-19 16:15:46 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This Software is the property of Data Development and is protected
|
|
|
|
* by copyright law - it is NOT Freeware.
|
|
|
|
* Any unauthorized use of this software without a valid license
|
|
|
|
* is a violation of the license agreement and will be prosecuted by
|
|
|
|
* civil and criminal law.
|
|
|
|
* https://www.d3data.de
|
|
|
|
*
|
|
|
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
|
|
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
|
|
|
* @link http://www.oxidmodule.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace D3\ModCfg\Application\Model\Exception;
|
|
|
|
|
2024-06-26 13:49:30 +02:00
|
|
|
use DateTimeImmutable;
|
2024-04-19 16:15:46 +02:00
|
|
|
use Exception;
|
|
|
|
use OxidEsales\Eshop\Core\Exception\StandardException;
|
|
|
|
use OxidEsales\Eshop\Core\Registry;
|
|
|
|
use OxidEsales\Eshop\Core\Utils;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* handle d3modprofile specific exceptions
|
|
|
|
*/
|
|
|
|
class d3modprofile_exception extends StandardException
|
|
|
|
{
|
|
|
|
private $_sModId;
|
|
|
|
|
|
|
|
protected $_sType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getString()
|
|
|
|
{
|
2024-06-26 13:49:30 +02:00
|
|
|
return self::class . " (time: " . (new DateTimeImmutable())->format('Y-m-d H:i:s')
|
|
|
|
. "): [{$this->code}]: {$this->message} - Faulty ModProfile: " . $this->getModCfgId();
|
2024-04-19 16:15:46 +02:00
|
|
|
//." \n Stack Trace: {$this->getTraceAsString()}\n\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
public function debugOut()
|
|
|
|
{
|
|
|
|
//We are most likely are already dealing with an exception so making sure no other exceptions interfere
|
|
|
|
try {
|
|
|
|
$sLogMsg = $this->getString() . "\n Stack Trace: {$this->getTraceAsString(
|
|
|
|
)} \n---------------------------------------------\n";
|
|
|
|
|
|
|
|
$logger = Registry::getLogger();
|
|
|
|
$logger->error($sLogMsg);
|
|
|
|
} catch (Exception) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $sModId
|
|
|
|
*/
|
|
|
|
public function setModCfgId($sModId)
|
|
|
|
{
|
|
|
|
$this->_sModId = $sModId;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getModCfgId()
|
|
|
|
{
|
|
|
|
return $this->_sModId;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $sType
|
|
|
|
*/
|
|
|
|
public function setExcType($sType)
|
|
|
|
{
|
|
|
|
$this->_sType = $sType;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getExcType()
|
|
|
|
{
|
|
|
|
return $this->_sType;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getExcMessage()
|
|
|
|
{
|
|
|
|
return $this->message;
|
|
|
|
}
|
|
|
|
}
|