ganeti
Safe HaskellNone

Ganeti.Errors

Description

Implementation of the Ganeti error types.

This module implements our error hierarchy. Currently we implement one identical to the Python one; later we might one to have separate ones for frontend (clients), master and backend code.

Synopsis

Documentation

data ErrorCode Source #

Error code types for OpPrereqError.

Instances

Instances details
Bounded ErrorCode # 
Instance details

Defined in Ganeti.Errors

Enum ErrorCode # 
Instance details

Defined in Ganeti.Errors

Eq ErrorCode # 
Instance details

Defined in Ganeti.Errors

Methods

(==) :: ErrorCode -> ErrorCode -> Bool

(/=) :: ErrorCode -> ErrorCode -> Bool

Ord ErrorCode # 
Instance details

Defined in Ganeti.Errors

Methods

compare :: ErrorCode -> ErrorCode -> Ordering

(<) :: ErrorCode -> ErrorCode -> Bool

(<=) :: ErrorCode -> ErrorCode -> Bool

(>) :: ErrorCode -> ErrorCode -> Bool

(>=) :: ErrorCode -> ErrorCode -> Bool

max :: ErrorCode -> ErrorCode -> ErrorCode

min :: ErrorCode -> ErrorCode -> ErrorCode

Show ErrorCode # 
Instance details

Defined in Ganeti.Errors

Methods

showsPrec :: Int -> ErrorCode -> ShowS

show :: ErrorCode -> String

showList :: [ErrorCode] -> ShowS

JSON ErrorCode # 
Instance details

Defined in Ganeti.Errors

Methods

readJSON :: JSValue -> Result ErrorCode

showJSON :: ErrorCode -> JSValue

readJSONs :: JSValue -> Result [ErrorCode]

showJSONs :: [ErrorCode] -> JSValue

Arbitrary ErrorCode 
Instance details

Defined in Test.Ganeti.Errors

errorCodeFromRaw :: forall m. (Monad m, MonadFail m) => String -> m ErrorCode Source #

data GanetiException Source #

Constructors

GenericError String 
LockError String 
PidFileLockError String 
HypervisorError String 
ProgrammerError String 
BlockDeviceError String 
ConfigurationError String 
ConfigVerifyError String [String] 
ConfigVersionMismatch Int Int 
ReservationError String 
RemoteError String 
SignatureError String 
ParameterError String 
ResultValidationError String 
OpPrereqError String ErrorCode 
OpExecError String 
OpResultError String 
OpCodeUnknown String 
JobLost String 
JobFileCorrupted String 
ResolverError String Int String 
HooksFailure String 
HooksAbort [(String, String, String)] 
UnitParseError String 
ParseError String 
TypeEnforcementError String 
X509CertError String String 
TagError String 
CommandError String 
StorageError String 
InotifyError String 
JobQueueError String 
JobQueueDrainError String 
JobQueueFull 
ConfdMagicError String 
ConfdClientError String 
UdpDataSizeError String 
NoCtypesError String 
IPAddressError String 
LuxiError String 
QueryFilterParseError String 
RapiTestResult String 
FileStoragePathError String 

Instances

Instances details
Eq GanetiException # 
Instance details

Defined in Ganeti.Errors

Show GanetiException # 
Instance details

Defined in Ganeti.Errors

Methods

showsPrec :: Int -> GanetiException -> ShowS

show :: GanetiException -> String

showList :: [GanetiException] -> ShowS

Error GanetiException # 
Instance details

Defined in Ganeti.Errors

JSON GanetiException # 
Instance details

Defined in Ganeti.Errors

Methods

readJSON :: JSValue -> Result GanetiException

showJSON :: GanetiException -> JSValue

readJSONs :: JSValue -> Result [GanetiException]

showJSONs :: [GanetiException] -> JSValue

Arbitrary GanetiException 
Instance details

Defined in Test.Ganeti.Errors

MonadError GanetiException RpcClientMonad 
Instance details

Defined in Ganeti.THH.HsRPC

type ErrorResult = GenericResult GanetiException Source #

Error monad using GanetiException type alias.

errorExitCode :: GanetiException -> ExitCode Source #

Returns the exit code of a program that should be used if we got back an exception from masterd.

formatError :: GanetiException -> String Source #

Formats an exception.

type ResultG = ResultT GanetiException IO Source #

A type for IO actions with errors properly handled as GanetiExceptions. TODO: Move to Errors.hs

errToResult :: ErrorResult a -> Result a Source #

Convert from an ErrorResult to a standard Result.

maybeToError :: String -> Maybe a -> ErrorResult a Source #

Convert from a Maybe to a an ErrorResult.