Ergo\Error\WebErrorHandler::handle PHP Method

handle() public method

* (non-phpdoc)
See also: ErrorHandler::handle()
public handle ( $e )
    public function handle($e)
    {
        $this->logException($e);
        if ($this->isExceptionHalting($e)) {
            // if headers are sent, we can't send a response
            if (headers_sent()) {
                echo $this->buildResponseBody($e);
                exit(0);
            }
            // send it off
            $sender = new Http\ResponseSender($this->buildResponse($e));
            $sender->send();
            if (ob_get_level() > 0) {
                ob_flush();
            }
            exit(self::EXIT_CODE);
        }
    }