Ergo\Error\ErrorProxy::_shutdown PHP Method

_shutdown() public method

PHP shutdown function to catch fatal errors
See also: http://www.eggplant.ws/blog/php/mayday-php-going-down/
See also: register_shutdown_function
public _shutdown ( )
    public function _shutdown()
    {
        if ($this->_registered && ($error = error_get_last())) {
            try {
                // clear the output buffer if we can
                if (ob_get_level() >= 1) {
                    ob_end_clean();
                }
                // build an error exception
                if (isset($error['type']) && in_array($error['type'], array(E_ERROR, E_PARSE, E_COMPILE_ERROR))) {
                    $this->_handleError($error['type'], $error['message'], $error['file'], $error['line']);
                }
            } catch (Exception $e) {
            }
        }
    }