hpqtypes-1.4.1: Haskell bindings to libpqtypes

Safe HaskellSafe-Inferred
LanguageHaskell98

Database.PostgreSQL.PQTypes.Internal.Error

Description

Definitions of exception types.

Synopsis

Documentation

newtype QueryError Source

Simple SQL query error. Thrown when there is no PGresult object corresponding to query execution.

Constructors

QueryError String 

newtype LibPQError Source

Internal error in libpq/libpqtypes library.

Constructors

LibPQError String 

data ConversionError Source

Data conversion error. Since it's polymorphic in error type, it nicely reports arbitrarily nested conversion errors.

Constructors

forall e . Exception e => ConversionError 

Fields

convColumn :: !Int

Column number (Starts with 1).

convColumnName :: !String

Name of the column.

convRow :: !Int

Row number (Starts with 1).

convError :: !e

Exact error.

data ArrayItemError Source

Array item error. Polymorphic in error type for the same reason as ConversionError.

Constructors

forall e . Exception e => ArrayItemError 

Fields

arrItemIndex :: !Int

Item index (Starts with 1).

arrItemError :: !e

Exact error.

data InvalidValue t Source

"Invalid value" error for various data types.

Constructors

InvalidValue 

Fields

ivValue :: t

Invalid value.

ivValidValues :: Maybe [t]
 

Instances

Eq t => Eq (InvalidValue t) 
Ord t => Ord (InvalidValue t) 
Show t => Show (InvalidValue t) 
(Show t, Typeable * t) => Exception (InvalidValue t) 
Typeable (* -> *) InvalidValue 

data RangeError t Source

Range error for various data types.

Constructors

RangeError 

Fields

reRange :: [(t, t)]

Allowed range (sum of acceptable ranges).

reValue :: t

Provided value which is not in above range.

Instances

Eq t => Eq (RangeError t) 
Ord t => Ord (RangeError t) 
Show t => Show (RangeError t) 
(Show t, Typeable * t) => Exception (RangeError t) 
Typeable (* -> *) RangeError 

data ArrayDimensionMismatch Source

Array dimenstion mismatch error.

Constructors

ArrayDimensionMismatch 

Fields

arrDimExpected :: !Int

Dimension expected by the library.

arrDimDelivered :: !Int

Dimension provided by the database.

data RowLengthMismatch Source

Row length mismatch error.

Constructors

RowLengthMismatch 

Fields

lengthExpected :: !Int

Length expected by the library.

lengthDelivered :: !Int

Length delivered by the database.

data AffectedRowsMismatch Source

Affected/returned rows mismatch error.

Constructors

AffectedRowsMismatch 

Fields

rowsExpected :: ![(Int, Int)]

Number of rows expected by the library, expressed as sum of acceptable ranges, eg. [(1,2), (5,10)] means that it would accept 1, 2, 5, 6, 7, 8, 9 or 10 affected/returned rows.

rowsDelivered :: !Int

Number of affected/returned rows by the database.