From 38861841802619c130cbb552c63a837e3a1f2870 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 13 May 2012 15:23:58 +0200 Subject: [PATCH] Add start/restart errors for terminated state --- frontend/locales/english.lng | 4 ++++ frontend/submodule.restart.php | 5 +++++ frontend/submodule.start.php | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/frontend/locales/english.lng b/frontend/locales/english.lng index a327cd3..4b9e4a5 100644 --- a/frontend/locales/english.lng +++ b/frontend/locales/english.lng @@ -164,6 +164,8 @@ error-start-success-title; Container started error-start-success-text; Your container was successfully started. error-start-suspended-title; Container is suspended error-start-suspended-text; Your container could not be started, as it is currently suspended. If you believe this is in error, please file a support ticket. +error-start-terminated-title; Container is terminated +error-start-terminated-text; Your container could not be started, as it is terminated. error-start-failed-title; Container failed to start error-start-failed-text; Your container could not be started. If this error persists, please file a support ticket. error-start-running-title; Container can't be started @@ -212,5 +214,7 @@ error-restart-success-title; Container restarted error-restart-success-text; Your container was successfully restarted. error-restart-suspended-title; Container is suspended error-restart-suspended-text; Your container could not be restarted, as it is currently suspended. If you believe this is in error, please file a support ticket. +error-restart-suspended-title; Container is terminated +error-restart-suspended-text; Your container could not be restarted, as it is terminated. error-restart-start-title; Container failed to start error-restart-start-text; Your container could not be started. If this error persists, please file a support ticket. diff --git a/frontend/submodule.restart.php b/frontend/submodule.restart.php index 66c84e3..3e2396f 100644 --- a/frontend/submodule.restart.php +++ b/frontend/submodule.restart.php @@ -35,6 +35,11 @@ catch (ContainerSuspendedException $e) $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-suspended-title'], $locale->strings['error-restart-suspended-text']); $sError .= $err->Render(); } +catch (ContainerTerminatedException $e) +{ + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-terminated-title'], $locale->strings['error-restart-terminated-text']); + $sError .= $err->Render(); +} catch(ContainerStartException $e) { $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-start-title'], $locale->strings['error-restart-start-text']); diff --git a/frontend/submodule.start.php b/frontend/submodule.start.php index ba8ac1a..7790529 100644 --- a/frontend/submodule.start.php +++ b/frontend/submodule.start.php @@ -28,6 +28,11 @@ if($sContainer->sCurrentStatus != CVM_STATUS_STARTED) $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-suspended-title'], $locale->strings['error-start-suspended-text']); $sError .= $err->Render(); } + catch (ContainerTerminatedException $e) + { + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-terminated-title'], $locale->strings['error-start-terminated-text']); + $sError .= $err->Render(); + } catch (ContainerStartException $e) { $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-failed-title'], $locale->strings['error-start-failed-text']);