From 3a81f55ac67cffa3906958d5e7d1025518606ef0 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 29 Apr 2012 12:51:51 +0200 Subject: [PATCH] Add some Container exceptions --- frontend/includes/include.exceptions.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/frontend/includes/include.exceptions.php b/frontend/includes/include.exceptions.php index 120ddbb..b721d38 100644 --- a/frontend/includes/include.exceptions.php +++ b/frontend/includes/include.exceptions.php @@ -13,8 +13,32 @@ if(!isset($_CVM)) { die("Unauthorized."); } +// SshConnector-related exceptions class SshConnectException extends Exception {} class SshAuthException extends Exception {} class SshCommandException extends Exception {} class SshExitException extends Exception {} + +// Container-related exceptions +class ContainerException extends Exception +{ + private $id = ""; + + public function __construct($message = "", $code = 0, $id = "", $previous = null) + { + $this->id = $id; + + parent::__construct($message, $code, $previous); + } + + public function getId() + { + return $this->id; + } +} + +class ContainerCreateException extends ContainerException {} +class ContainerConfigureException extends ContainerException {} +class ContainerStartException extends ContainerException {} +class ContainerStopException extends ContainerException {} ?>