protected function errorHandler(\Exception $e, $url = "")
    {
        $this->errorOccurred = true;
        $this->requestFile = $this->pluginDir . '/content/error.md';
        if ($this->config["debug"] === true) {
            $this->addOutput("_exception", (string)$e);
        }
        $this->logger->critical(
            "Exception on url '{url}': {e}",
            array(
                "url" => $url,
                "e" => $e
            )
        );
        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);

        // Change url to prevent other plugins that use url-based routing from
        // changing the request file.
        $this->requestUrl="500";
    }