( ErrorCode(..)
, GanetiException(..)
, ErrorResult
- , excName
+ , errToResult
, errorExitCode
+ , excName
, formatError
) where
"Unhandled Ganeti error: " ++ msg
formatError err =
"Unhandled exception: " ++ show err
+
+-- | Convert from an 'ErrorResult' to a standard 'Result'.
+errToResult :: ErrorResult a -> Result a
+errToResult (Ok a) = Ok a
+errToResult (Bad e) = Bad $ formatError e