diff options
| author | Yoggzo <yogg@epsina.com> | 2016-03-27 19:40:36 +0200 |
|---|---|---|
| committer | Yoggzo <yogg@epsina.com> | 2016-03-27 19:40:36 +0200 |
| commit | 19d84e2ae4c6710aac2236df4f135409ef519fc8 (patch) | |
| tree | 1a39ae08133c2d6d01bfc93e124d1faf0d8be2a8 /server/core/ErrorManagement.php | |
| parent | e9c7477ff0acedf9b49e508e1543395bbcbf7533 (diff) | |
Update commentaries
Diffstat (limited to 'server/core/ErrorManagement.php')
| -rwxr-xr-x | server/core/ErrorManagement.php | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/server/core/ErrorManagement.php b/server/core/ErrorManagement.php index e7cb83e..be7080b 100755 --- a/server/core/ErrorManagement.php +++ b/server/core/ErrorManagement.php @@ -1,4 +1,13 @@ <?php
+/**
+* File containing the Errormanagement Class.
+*
+* @version 1.0 Initialisation of this file
+* @since 1.0 Core application's file
+*
+* @author Eole 'eoledev at outlook . fr', Evan Pisani 'yogg at epsina . com'
+*
+*/
use OpenCloud\Common\Error\BadResponseError;
use OpenCloud\Common\Error\BaseError;
@@ -7,20 +16,40 @@ use OpenCloud\Common\Error\UserInputError; Class errorManagement{
-
+ /** @var App $app protected, contains the main app object */
protected $app;
-
+ /**
+ * ErrorManagemement constructor
+ *
+ * @param App $app the main app object
+ *
+ * @return ErrorManagement
+ */
public function __construct($args){
$this->app = $args;
}
+ /**
+ * Put an error message corresponding to a base error in the output
+ *
+ * @param $error the error triggered
+ *
+ * @return String BaseError message
+ */
public function BaseErrorHandler($error){
$this->app->setOutput("Error", "BaseError");
}
+ /**
+ * Put an error message corresponding to a bad response in function of the status code in the output
+ *
+ * @param $error the error triggered
+ *
+ * @return String Error message
+ */
public function BadResponseHandler($error){
$statusCode = $error->getResponse()->getStatusCode();
switch ($statusCode) {
@@ -54,19 +83,39 @@ Class errorManagement{ }
}
+ /**
+ * Put an error message corresponding to a not implemented yet error in the output
+ *
+ * @param $error the error triggered
+ *
+ * @return String internal error message
+ */
public function NotImplementedHandler($error){
$this->app->setOutput("Error", "Internal error (not implemented yet), please contact an administrator");
}
+ /**
+ * Put an error message corresponding to a user input error in the output
+ *
+ * @param $error the error triggered
+ *
+ * @return String User input error message
+ */
public function UserInputHandler($error){
$this->app->setOutput("Error", "UserInputError");
}
+ /**
+ * Put an error message corresponding to an other error in the output
+ *
+ * @param $error the error triggered
+ *
+ * @return String error message
+ */
public function OtherException($error){
$this->app->setOutput("Error", $error->getMessage());
}
-
}
?>
|
