src/snac/client/webui/WebUIExecutor.php
/**
     * Draw the Error Page
     *
     * Helper function to draw the error page when something goes wrong with the Server query.
     *
     * @param  string[] $serverResponse The response from the server
     * @param  \snac\client\webui\display\Display $display  The display object from the WebUI
     * @return boolean False, since an error occurred to get here
     */
Draw the Error Page
Helper function to draw the error page when something goes wrong with the Server query.


Draw the Error Page Helper function to draw the error page when something goes wrong with the Server query .
public function drawErrorPage($serverResponse, &$display) {
        $this->logger->addDebug("Drawing Error page", array($serverResponse));
        if (is_array($serverResponse) && isset($serverResponse["error"]) && isset($serverResponse["error"]["type"])) {
            if ($serverResponse["error"]["type"] == "Permission Error") {
                return $this->displayPermissionDeniedPage(null, $display);
            } else if ($serverResponse["error"]["type"] == "Concurrent Edit Error") {
                return $this->displayConcurrentEditErrorPage(null, $display);
            }
            $display->setTemplate("error_page");
            $display->setData($serverResponse["error"]);
        } else if (is_array($serverResponse)) {
            $display->setTemplate("error_page");
            $display->setData(array("type" => "System Error", "message" => print_r($serverResponse, true), "display" => "pre"));
        } else {
            $this->logger->addDebug("Drawing the text version of the error page");
            $display->setTemplate("error_page");
            $display->setData(array("type" => "System Error", "message" => $serverResponse, "display" => "pre"));
        }
        return false;
    }
public function drawErrorPage ( $ serverResponse , & $ display ) { $ this -> logger -> addDebug ( " Drawing Error page " , array ( $ serverResponse ) ) ; if ( is_array ( $ serverResponse ) && isset ( $ serverResponse [ " error " ] ) && isset ( $ serverResponse [ " error " ] [ " type " ] ) ) { if ( $ serverResponse [ " error " ] [ " type " ] == " Permission Error " ) { return $ this -> displayPermissionDeniedPage ( null , $ display ) ; } else if ( $ serverResponse [ " error " ] [ " type " ] == " Concurrent Edit Error " ) { return $ this -> displayConcurrentEditErrorPage ( null , $ display ) ; } $ display -> setTemplate ( " error_page " ) ; $ display -> setData ( $ serverResponse [ " error " ] ) ; } else if ( is_array ( $ serverResponse ) ) { $ display -> setTemplate ( " error_page " ) ; $ display -> setData ( array ( " type " => " System Error " , " message " => print_r ( $ serverResponse , true ) , " display " => " pre " ) ) ; } else { $ this -> logger -> addDebug ( " Drawing the text version of the error page " ) ; $ display -> setTemplate ( " error_page " ) ; $ display -> setData ( array ( " type " => " System Error " , " message " => $ serverResponse , " display " => " pre " ) ) ; } return false ; }
Draw the Error Page
 Helper function to draw the error page when something goes wrong with the Server query.
Draw the Error Page Helper function to draw the error page when something goes wrong with the Server query .