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.
- data ErrorCode
- = ECodeResolver
- | ECodeNoRes
- | ECodeTempNoRes
- | ECodeInval
- | ECodeState
- | ECodeNoEnt
- | ECodeExists
- | ECodeNotUnique
- | ECodeFault
- | ECodeEnviron
- errorCodeFromRaw :: forall m. Monad m => String -> m ErrorCode
- errorCodeToRaw :: ErrorCode -> String
- data GanetiException
- = GenericError String
- | LockError String
- | PidFileLockError String
- | HypervisorError String
- | ProgrammerError String
- | BlockDeviceError String
- | ConfigurationError 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
- errToResult :: ErrorResult a -> Result a
- maybeToError :: String -> Maybe a -> ErrorResult a
Documentation
Error code types for OpPrereqError
.
errorCodeFromRaw :: forall m. Monad m => String -> m ErrorCodeSource
errorCodeToRaw :: ErrorCode -> StringSource
data GanetiException Source
GenericError String | |
LockError String | |
PidFileLockError String | |
HypervisorError String | |
ProgrammerError String | |
BlockDeviceError String | |
ConfigurationError 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 |
Eq GanetiException | |
Show GanetiException | |
Arbitrary GanetiException | |
Error GanetiException | |
JSON GanetiException |
saveGanetiException :: GanetiException -> JSValueSource
loadGanetiException :: JSValue -> Result GanetiExceptionSource
type ErrorResult = GenericResult GanetiExceptionSource
Error monad using GanetiException
type alias.
excName :: GanetiException -> StringSource
errorExitCode :: GanetiException -> ExitCodeSource
Returns the exit code of a program that should be used if we got back an exception from masterd.
formatError :: GanetiException -> StringSource
Formats an exception.
errToResult :: ErrorResult a -> Result aSource
Convert from an ErrorResult
to a standard Result
.
maybeToError :: String -> Maybe a -> ErrorResult aSource
Convert from a Maybe
to a an ErrorResult
.