public function execute()
    {
        try
        {
            // No output should be produced by apps directly, so buffer
            // everything, and log afterwards
            $this->output_buffer_level = ob_get_level();

            ob_start();
            $response = $this->doExecute();

            if (
                (is_object($response) && !($response instanceof Response)) || 
                (is_string($response) && class_exists($response))
            )
            {
                $response = $this->reflect($response);
            }

            if ($response instanceof Response)
                throw $response;


            throw new HTTPError(500, "App did not produce any response");
        }
        catch (Response $response)
        {
            self::$logger->debug("Response type {0} returned from controller: {1}", [get_class($response), $this->app]);
            throw $response;
        }
        catch (Throwable $e)
        {
            self::$logger->debug("While executing controller: {0}", [$this->app]);
            self::$logger->notice(
                "Unexpected exception of type {0} thrown while processing request: {1}", 
                [get_class($e), $e]
            );

            throw $e;
        }
        finally
        {
            $this->logScriptOutput();
        }
    }