sharillibe/ILLI — pull request #23 by icro (2013-03-23 20:41:00+00:00)
Title: throwable fatal error: catch/bypass parser added

```php

CLASS Trap EXTENDS \ILLI\Core\Std\Throwable
{
CONST TRAP	= TRUE;
CONST SHUTDOWN	= TRUE;

public static function run()
{
static::$__parser = function($i)
{
extract($i);

// do nothing with errors from crappy wp code
if(strpos($file, 'wp-includes'))
return FALSE;

return TRUE;
};

static::$__handle['shutdown'] = function()
{
print Trace::html();
print Error::html();
};

parent::run();
}
}

```

```php
CLASS Theme
{
function __construct(__config_Theme $__Setup)
{
if(Trap::isRunning())
Trap::stop();

Trap::config(
[
'code' => E_ALL,
'fire' => function($Exception = NULL)
{
Error::add($Exception['Exception']->toTrack()->asText());
}
]);

Trap::run();
```