on ffe683a help sign in
50 lines 2.7 kB history raw
1{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
2module ProjectM36.Error where
3import ProjectM36.Base
4import qualified Data.Set as S
5import qualified Data.UUID as U
6import Control.DeepSeq (NFData, rnf)
7import Control.DeepSeq.Generics (genericRnf)
8import GHC.Generics (Generic)
9import qualified Data.Text as T
10import Data.Binary
11import Data.Typeable
13data RelationalError = NoSuchAttributeNamesError (S.Set AttributeName)
14 | TupleAttributeCountMismatchError Int --attribute name
15 | TupleAttributeTypeMismatchError Attributes
16 | AttributeCountMismatchError Int
17 | AttributeNamesMismatchError (S.Set AttributeName)
18 | AttributeNameInUseError AttributeName
19 | AttributeIsNotRelationValuedError AttributeName
20 | RelVarNotDefinedError RelVarName
21 | RelVarAlreadyDefinedError RelVarName
22 | RelVarAssignmentTypeMismatchError Attributes Attributes --expected, found
23 | InclusionDependencyCheckError IncDepName
24 | InclusionDependencyNameInUseError IncDepName
25 | InclusionDependencyNameNotInUseError IncDepName
26 | ParseError T.Text
27 | PredicateExpressionError T.Text
28 | NoSuchTransactionError U.UUID
29 | NoSuchHeadNameError HeadName
30 | TransactionIsNotAHeadError U.UUID
31 | TransactionGraphCycleError U.UUID
32 | NoSuchTupleExprFunctionError AtomFunctionName
33 | AtomTypeMismatchError AtomType AtomType
34 | AtomTypeNotSupported AttributeName --used by persistent driver
35 | AtomOperatorNotSupported T.Text --used by persistent driver
36 | EmptyTuplesError -- used by persistent driver
37 | AtomTypeCountError [AtomType] [AtomType]
38 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
39 | RelationValuedAttributesNotSupportedError [AttributeName]
40 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
41 | ExportError T.Text
42 deriving (Show,Eq,Generic,Binary,Typeable)
44instance NFData RelationalError where rnf = genericRnf
46data PersistenceError = InvalidDirectoryError FilePath |
47 MissingTransactionError U.UUID
48 deriving (Show, Eq)