2022-11-03 13:18:02 +01:00
|
|
|
<?php
|
|
|
|
|
2022-11-04 22:02:44 +01:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
* http://www.shopmodule.com
|
|
|
|
*
|
|
|
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
|
|
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
|
|
|
* @link http://www.oxidmodule.com
|
|
|
|
*/
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-11-03 13:18:02 +01:00
|
|
|
namespace D3\Webauthn\Application\Model\Exceptions;
|
|
|
|
|
|
|
|
use D3\Webauthn\Application\Model\WebauthnErrors;
|
2022-11-03 23:59:14 +01:00
|
|
|
use Exception;
|
2022-11-03 13:18:02 +01:00
|
|
|
use OxidEsales\Eshop\Core\Exception\StandardException;
|
|
|
|
|
|
|
|
class WebauthnException extends StandardException
|
|
|
|
{
|
|
|
|
public $detailedErrorMessage = null;
|
|
|
|
|
2022-11-03 23:59:14 +01:00
|
|
|
public function __construct( $sMessage = "not set", $iCode = 0, Exception $previous = null )
|
2022-11-03 13:18:02 +01:00
|
|
|
{
|
|
|
|
$this->setDetailedErrorMessage($sMessage);
|
|
|
|
|
|
|
|
parent::__construct(
|
|
|
|
(oxNew(WebauthnErrors::class))->translateError($sMessage, $this->getRequestType()),
|
|
|
|
$iCode,
|
|
|
|
$previous
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string|null
|
|
|
|
*/
|
|
|
|
public function getRequestType(): ?string
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return null|string
|
|
|
|
*/
|
|
|
|
public function getDetailedErrorMessage(): ?string
|
|
|
|
{
|
|
|
|
return $this->detailedErrorMessage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string|null $detailedErrorMessage
|
|
|
|
*/
|
|
|
|
public function setDetailedErrorMessage(string $detailedErrorMessage = null): void
|
|
|
|
{
|
2022-11-04 00:12:42 +01:00
|
|
|
$this->detailedErrorMessage = 'Webauthn: '.$detailedErrorMessage;
|
2022-11-03 13:18:02 +01:00
|
|
|
}
|
|
|
|
}
|