-
Notifications
You must be signed in to change notification settings - Fork 0
/
Error.php
executable file
·42 lines (36 loc) · 1.29 KB
/
Error.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
/*
* This file is part of the QuidPHP package <https://quidphp.com>
* Author: Pierre-Philippe Emond <emondpph@gmail.com>
* License: https://github.com/quidphp/core/blob/master/LICENSE
*/
namespace Quid\Core;
use Quid\Base;
use Quid\Main;
// error
// extended class used as an error handler
class Error extends Main\Error
{
// config
protected static array $config = [
'logClass'=>[Row\LogError::class,Main\File\Error::class], // classe pour log, , s'il y a en plusieurs utilise seulement le premier qui fonctionne
'type'=>[ // description des types additionneles à boot
33=>['key'=>'dbException','name'=>'Database Exception'],
34=>['key'=>'dbException','name'=>'Catchable database exception'],
35=>['key'=>'routeException','name'=>'Route Exception'],
36=>['key'=>'routeBreakException','name'=>'Route break exception']]
];
// init
// initialise la prise en charge des erreurs, exception et assertion
final public static function init():void
{
parent::init();
Base\Error::setHandler([static::class,'handler']);
Base\Exception::setHandler([static::class,'exception']);
Base\Assert::setHandler([static::class,'assert']);
}
}
// init
Error::__init();
?>