summaryrefslogtreecommitdiff
path: root/server/core/App.php
diff options
context:
space:
mode:
Diffstat (limited to 'server/core/App.php')
-rwxr-xr-xserver/core/App.php32
1 files changed, 30 insertions, 2 deletions
diff --git a/server/core/App.php b/server/core/App.php
index bba99b4..ff2e1af 100755
--- a/server/core/App.php
+++ b/server/core/App.php
@@ -1,13 +1,21 @@
<?php
include_once("core/Plugin_Api.php");
include_once("core/LibOverride/genTokenOptions.php");
+include_once("core/ErrorManagement.php");
+
+use OpenStack\Common\Error\BadResponseError;
+use OpenStack\Common\Error\BaseError;
+use OpenStack\Common\Error\NotImplementedError;
+use OpenStack\Common\Error\UserInputError;
class App{
protected $openstack;
protected $pluginsApi;
+ protected $postParams;
protected $tokenClass;
protected $tokenPost;
+ protected $errorClass;
protected $output;
public function __construct($args){
@@ -16,7 +24,9 @@ class App{
$this->tokenClass = new genTokenOptions($args);
$this->openstack = new OpenStack\OpenStack([]);
$this->pluginsApi = plugin_api::getInstance();
+ $this->errorClass = new errorManagement($this);
$this->output = array();
+ $this->postParams = $_POST;
}
@@ -53,19 +63,37 @@ class App{
$this->tokenClass->genNetworkToken();
$this->setOutput("token", $this->tokenClass->getBackup());
- }catch(Exception $e){
- echo $e;
+ }catch(BadResponseError $e){
+ var_dump($e);
+ }catch(UserInputError $e){
+ var_dump($e);
+ }catch(BaseError $e){
+ var_dump($e);
exit();
+ }catch(NotImplementedError $e){
+ var_dump($e);
}
}
+ public function getPostParam($name){
+
+ return $this->postParams[$name];
+
+ }
+
public function setOutput($key, $out){
$this->output[$key] = $out;
}
+ public function getErrorInstance(){
+
+ return $this->errorClass;
+
+ }
+
public function show(){
echo json_encode($this->output);
}