memcache-0.3.0.2: A memcached client library.
Copyright(c) David Terei 2016
LicenseBSD
Maintainercode@davidterei.com
Stabilitystable
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Memcache.Errors

Description

Memcached related errors and exception handling.

Synopsis

Error types

data MemcacheError Source #

All exceptions that a Memcached client may throw.

Constructors

OpError Status

Memcached operation error.

ClientError ClientError

Error occuring on client side.

ProtocolError ProtocolError

Errors occurring communicating with Memcached server.

data Status Source #

The status (success or error) of a Memcached operation returned in a Response.

Constructors

NoError

Operation successful.

ErrKeyNotFound

Key not found.

ErrKeyExists

Key exists when not expected.

ErrValueTooLarge

Value too large to store at server.

ErrInvalidArgs

Invalid arguments for operation.

ErrItemNotStored

Key-Value pair not stored at server (internal error).

ErrValueNonNumeric

Value not numeric when increment or decrement requested.

ErrUnknownCommand

Server doesn't know requested command.

ErrOutOfMemory

Server out of memory.

SaslAuthFail

SASL authentication failed.

SaslAuthContinue

SASL authentication requires more steps.

Instances

Instances details
Show Status Source # 
Instance details

Defined in Database.Memcache.Types

Eq Status Source # 
Instance details

Defined in Database.Memcache.Types

Methods

(==) :: Status -> Status -> Bool #

(/=) :: Status -> Status -> Bool #

data ClientError Source #

Errors that occur on the client.

Constructors

NoServersReady

All servers are currently marked failed.

Timeout

Timeout occurred sending request to server.

Instances

Instances details
Show ClientError Source # 
Instance details

Defined in Database.Memcache.Errors

Eq ClientError Source # 
Instance details

Defined in Database.Memcache.Errors

data ProtocolError Source #

Errors related to Memcached protocol and bytes on the wire.

Constructors

UnknownPkt

Received an unknown response packet.

UnknownOp

Unknown Memcached operation.

UnknownStatus

Unknown Memcached status field value.

BadLength

Unexpected length of a Memcached field (extras, key, or value).

WrongOp

Response packet is for a different operation than expected.

UnexpectedEOF

Network socket closed without receiving enough bytes.

Instances

Instances details
Show ProtocolError Source # 
Instance details

Defined in Database.Memcache.Errors

Eq ProtocolError Source # 
Instance details

Defined in Database.Memcache.Errors

Error creation

throwStatus :: Status -> IO a Source #

Convert a status to MemcacheError exception.

wrongOp :: Response -> String -> MemcacheError Source #

Create a properly formatted WrongOp protocol error.