throw error type dependend exceptions
This commit is contained in:
parent
236680ad7a
commit
88b6a1d6fa
22
Application/Models/Exceptions/CompileErrorException.php
Normal file
22
Application/Models/Exceptions/CompileErrorException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\DebugBar\Application\Models\Exceptions;
|
||||
|
||||
use ErrorException;
|
||||
|
||||
class CompileErrorException extends ErrorException
|
||||
{
|
||||
}
|
22
Application/Models/Exceptions/CoreErrorException.php
Normal file
22
Application/Models/Exceptions/CoreErrorException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\DebugBar\Application\Models\Exceptions;
|
||||
|
||||
use ErrorException;
|
||||
|
||||
class CoreErrorException extends ErrorException
|
||||
{
|
||||
}
|
22
Application/Models/Exceptions/ParseException.php
Normal file
22
Application/Models/Exceptions/ParseException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\DebugBar\Application\Models\Exceptions;
|
||||
|
||||
use ErrorException;
|
||||
|
||||
class ParseException extends ErrorException
|
||||
{
|
||||
}
|
22
Application/Models/Exceptions/UserErrorException.php
Normal file
22
Application/Models/Exceptions/UserErrorException.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* https://www.d3data.de
|
||||
*
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||
* @link https://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\DebugBar\Application\Models\Exceptions;
|
||||
|
||||
use ErrorException;
|
||||
|
||||
class UserErrorException extends ErrorException
|
||||
{
|
||||
}
|
@ -16,6 +16,10 @@ declare(strict_types=1);
|
||||
namespace D3\DebugBar\Modules\Core;
|
||||
|
||||
use D3\DebugBar\Application\Component\DebugBarComponent;
|
||||
use D3\DebugBar\Application\Models\Exceptions\CompileErrorException;
|
||||
use D3\DebugBar\Application\Models\Exceptions\CoreErrorException;
|
||||
use D3\DebugBar\Application\Models\Exceptions\ParseException;
|
||||
use D3\DebugBar\Application\Models\Exceptions\UserErrorException;
|
||||
use D3\DebugBar\Core\DebugBarExceptionHandler;
|
||||
use DebugBar\DataCollector\ExceptionsCollector;
|
||||
use ErrorException;
|
||||
@ -55,9 +59,21 @@ class ShopControl_DebugBar extends ShopControl_DebugBar_parent
|
||||
[ $file, $line ] = $smartyTemplate;
|
||||
}
|
||||
|
||||
throw new ErrorException( $message, 0, $severity, $file, $line );
|
||||
switch($severity) {
|
||||
case E_CORE_ERROR:
|
||||
throw new CoreErrorException($message, 0, $severity, $file, $line);
|
||||
case E_COMPILE_ERROR:
|
||||
throw new CompileErrorException($message, 0, $severity, $file, $line);
|
||||
case E_USER_ERROR:
|
||||
throw new UserErrorException($message, 0, $severity, $file, $line);
|
||||
case E_PARSE:
|
||||
throw new ParseException($message, 0, $severity, $file, $line);
|
||||
case E_ERROR:
|
||||
default:
|
||||
throw new ErrorException($message, 0, $severity, $file, $line);
|
||||
}
|
||||
},
|
||||
E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR
|
||||
E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_PARSE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user