Safe Haskell | None |
---|
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
- data ErrorCode
- errorCodeFromRaw :: forall m. (Monad m, MonadFail m) => String -> m ErrorCode
- errorCodeToRaw :: ErrorCode -> String
- data GanetiException
- = 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
- saveGanetiException :: GanetiException -> JSValue
- loadGanetiException :: JSValue -> Result GanetiException
- type ErrorResult = GenericResult GanetiException
- excName :: GanetiException -> String
- errorExitCode :: GanetiException -> ExitCode
- formatError :: GanetiException -> String
- type ResultG = ResultT GanetiException IO
- errToResult :: ErrorResult a -> Result a
- maybeToError :: String -> Maybe a -> ErrorResult a
Documentation
Error code types for OpPrereqError
.
ECodeResolver | |
ECodeNoRes | |
ECodeTempNoRes | |
ECodeInval | |
ECodeState | |
ECodeNoEnt | |
ECodeExists | |
ECodeNotUnique | |
ECodeFault | |
ECodeEnviron |
Instances
Bounded ErrorCode # | |
Defined in Ganeti.Errors | |
Enum ErrorCode # | |
Eq ErrorCode # | |
Ord ErrorCode # | |
Defined in Ganeti.Errors | |
Show ErrorCode # | |
JSON ErrorCode # | |
Arbitrary ErrorCode | |
errorCodeFromRaw :: forall m. (Monad m, MonadFail m) => String -> m ErrorCode Source #
errorCodeToRaw :: ErrorCode -> String Source #
data GanetiException Source #
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
Eq GanetiException # | |
Defined in Ganeti.Errors (==) :: GanetiException -> GanetiException -> Bool (/=) :: GanetiException -> GanetiException -> Bool | |
Show GanetiException # | |
Defined in Ganeti.Errors showsPrec :: Int -> GanetiException -> ShowS show :: GanetiException -> String showList :: [GanetiException] -> ShowS | |
Error GanetiException # | |
Defined in Ganeti.Errors strMsg :: String -> GanetiException | |
JSON GanetiException # | |
Defined in Ganeti.Errors readJSON :: JSValue -> Result GanetiException showJSON :: GanetiException -> JSValue readJSONs :: JSValue -> Result [GanetiException] showJSONs :: [GanetiException] -> JSValue | |
Arbitrary GanetiException | |
Defined in Test.Ganeti.Errors arbitrary :: Gen GanetiException shrink :: GanetiException -> [GanetiException] | |
MonadError GanetiException RpcClientMonad | |
Defined in Ganeti.THH.HsRPC throwError :: GanetiException -> RpcClientMonad a catchError :: RpcClientMonad a -> (GanetiException -> RpcClientMonad a) -> RpcClientMonad a |
saveGanetiException :: GanetiException -> JSValue Source #
loadGanetiException :: JSValue -> Result GanetiException Source #
type ErrorResult = GenericResult GanetiException Source #
Error monad using GanetiException
type alias.
excName :: GanetiException -> String Source #
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
GanetiException
s.
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
.