summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/Exception.hs
diff options
context:
space:
mode:
authorJoey Hess2016-06-13 18:56:52 -0400
committerJoey Hess2016-06-13 18:56:52 -0400
commit490249b919aaf82527b81c88c88350fd478dbed9 (patch)
tree1d136bb0f71bac53bdd64248bc9ab1387ee10b4b /src/Propellor/Types/Exception.hs
parentb75ee60844fc56d361c5fac5a1038eebd33f26ba (diff)
add stopPropellorMessage
Diffstat (limited to 'src/Propellor/Types/Exception.hs')
-rw-r--r--src/Propellor/Types/Exception.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Propellor/Types/Exception.hs b/src/Propellor/Types/Exception.hs
new file mode 100644
index 00000000..3a810d55
--- /dev/null
+++ b/src/Propellor/Types/Exception.hs
@@ -0,0 +1,21 @@
+module Propellor.Types.Exception where
+
+import Data.Typeable
+import Control.Exception
+
+-- | Normally when an exception is encountered while propellor is
+-- ensuring a property, the property fails, but propellor robustly
+-- continues on to the next property.
+--
+-- This is the only exception that will stop the entire propellor run,
+-- preventing any subsequent properties of the Host from being ensured.
+-- (When propellor is running in a container in a Host, this exception only
+-- stops the propellor run in the container; the outer run in the Host
+-- continues.)
+--
+-- You should only throw this exception when things are so badly messed up
+-- that it's best for propellor to not try to do anything else.
+data StopPropellorException = StopPropellorException String
+ deriving (Show, Typeable)
+
+instance Exception StopPropellorException