on 48a1cfd help sign in
52 lines 2.8 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 | SessionIdInUse U.UUID
33 | NoSuchSession U.UUID
34 | NoSuchTupleExprFunctionError AtomFunctionName
35 | AtomTypeMismatchError AtomType AtomType
36 | AtomTypeNotSupported AttributeName --used by persistent driver
37 | AtomOperatorNotSupported T.Text --used by persistent driver
38 | EmptyTuplesError -- used by persistent driver
39 | AtomTypeCountError [AtomType] [AtomType]
40 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
41 | RelationValuedAttributesNotSupportedError [AttributeName]
42 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
43 | ExportError T.Text
44 deriving (Show,Eq,Generic,Binary,Typeable)
46instance NFData RelationalError where rnf = genericRnf
48data PersistenceError = InvalidDirectoryError FilePath |
49 MissingTransactionError U.UUID
50 deriving (Show, Eq)