on 3a76afa help sign in
49 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
12data RelationalError = NoSuchAttributeNamesError (S.Set AttributeName)
13 | TupleAttributeCountMismatchError Int --attribute name
14 | TupleAttributeTypeMismatchError Attributes
15 | AttributeCountMismatchError Int
16 | AttributeNamesMismatchError (S.Set AttributeName)
17 | AttributeNameInUseError AttributeName
18 | AttributeIsNotRelationValuedError AttributeName
19 | RelVarNotDefinedError RelVarName
20 | RelVarAlreadyDefinedError RelVarName
21 | RelVarAssignmentTypeMismatchError Attributes Attributes --expected, found
22 | InclusionDependencyCheckError IncDepName
23 | InclusionDependencyNameInUseError IncDepName
24 | InclusionDependencyNameNotInUseError IncDepName
25 | ParseError T.Text
26 | PredicateExpressionError T.Text
27 | NoSuchTransactionError U.UUID
28 | NoSuchHeadNameError HeadName
29 | TransactionIsNotAHeadError U.UUID
30 | TransactionGraphCycleError U.UUID
31 | NoSuchTupleExprFunctionError AtomFunctionName
32 | AtomTypeMismatchError AtomType AtomType
33 | AtomTypeNotSupported AttributeName --used by persistent driver
34 | AtomOperatorNotSupported T.Text --used by persistent driver
35 | EmptyTuplesError -- used by persistent driver
36 | AtomTypeCountError [AtomType] [AtomType]
37 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
38 | RelationValuedAttributesNotSupportedError [AttributeName]
39 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
40 | ExportError T.Text
41 deriving (Show,Eq,Generic,Binary)
43instance NFData RelationalError where rnf = genericRnf
45data PersistenceError = InvalidDirectoryError FilePath |
46 MissingTransactionError U.UUID
47 deriving (Show, Eq)