private function handleBuffer($buffer) {
        $error = error_get_last();

        if ( $error ) {
            $matches = [];
            preg_match('/\: (.*) in /', $error['message'], $matches);
            $message = key_exists(1, $matches) ? $matches[1] : $error['message'];
            
            /* @var $response \PowerOn\Network\Response */
            $response = $this->_container['Response'];
            
            if ( DEV_ENVIRONMENT ) {
                $response->setHeader(500);
                return 
                      '<header>'
                        . '<h1>Error: ' . $message . '</h1>'
                        . '<h2>' . $error['file'] . ' (' . $error['line'] . ')</h2>'
                    . '</header>';
            } else {
                /* @var $logger \Monolog\Logger */
                $logger = $this->_container['Logger'];
                $logger->error($message, [
                    'type' => $error['type'],
                    'file' => $error['file'],
                    'line' => $error['line']
                ]);

                /* @var $router \AltoRouter */
                $router = $this->_container['AltoRouter'];

                $response->redirect( $router->generate('poweron_error', ['error' => 500]) );
            }
        }

        return $buffer;
    }