1{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
2module ProjectM36.Error where
4import qualified Data.Set as S
5import Control.DeepSeq (NFData, rnf)
6import Control.DeepSeq.Generics (genericRnf)
7import GHC.Generics (Generic)
8import qualified Data.Text as T
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 | CouldNotInferAttributes
20 | RelVarNotDefinedError RelVarName
21 | RelVarAlreadyDefinedError RelVarName
22 | RelVarAssignmentTypeMismatchError Attributes Attributes --expected, found
23 | InclusionDependencyCheckError IncDepName
24 | InclusionDependencyNameInUseError IncDepName
25 | InclusionDependencyNameNotInUseError IncDepName
27 | PredicateExpressionError T.Text
28 | NoCommonTransactionAncestorError TransactionId TransactionId
29 | NoSuchTransactionError TransactionId
30 | RootTransactionTraversalError
31 | HeadNameSwitchingHeadProhibitedError HeadName
32 | NoSuchHeadNameError HeadName
33 | NewTransactionMayNotHaveChildrenError TransactionId
34 | NewTransactionMissingParentError TransactionId
35 | TransactionIsNotAHeadError TransactionId
36 | TransactionGraphCycleError TransactionId
37 | SessionIdInUseError TransactionId
38 | NoSuchSessionError TransactionId
39 | FailedToFindTransactionError TransactionId
40 | TransactionIdInUseError TransactionId
41 | NoSuchTupleExprFunctionError AtomFunctionName
42 | NoSuchTypeConstructorName TypeConstructorName
43 | TypeConstructorAtomTypeMismatch TypeConstructorName AtomType
44 | AtomTypeMismatchError AtomType AtomType
45 | TypeConstructorNameMismatch TypeConstructorName TypeConstructorName
46 | AtomTypeTypeConstructorReconciliationError AtomType TypeConstructorName
47 | DataConstructorNameInUseError DataConstructorName
48 | DataConstructorUsesUndeclaredTypeVariable TypeVarName
49 | TypeConstructorTypeVarsMismatch (S.Set TypeVarName) (S.Set TypeVarName)
50 | TypeConstructorTypeVarMissing TypeVarName
51 | TypeConstructorTypeVarsTypesMismatch TypeConstructorName TypeVarMap TypeVarMap
52 | DataConstructorTypeVarsMismatch DataConstructorName TypeVarMap TypeVarMap
53 | AtomTypeNameInUseError AtomTypeName
54 | IncompletelyDefinedAtomTypeWithConstructorError
55 | AtomTypeNameNotInUseError AtomTypeName
56 | AtomFunctionNameInUseError AtomFunctionName
57 | AtomFunctionNameNotInUseError AtomFunctionName
58 | AtomFunctionArgumentCountMismatch Int Int
59 | NoSuchDataConstructorError DataConstructorName
60 | NoSuchTypeConstructorError TypeConstructorName
61 | InvalidAtomTypeName AtomTypeName
62 | AtomTypeNotSupported AttributeName --used by persistent driver
63 | AtomOperatorNotSupported T.Text --used by persistent driver
64 | EmptyTuplesError -- used by persistent driver
65 | AtomTypeCountError [AtomType] [AtomType]
66 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
67 | RelationValuedAttributesNotSupportedError [AttributeName]
68 | NotificationNameInUseError NotificationName
69 | NotificationNameNotInUseError NotificationName
70 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
72 | UnhandledExceptionError String
73 | MergeTransactionError MergeError
74 | AtomFunctionBodyScriptError AtomFunctionBodyCompilationError
75 | MultipleErrors [RelationalError]
76 deriving (Show,Eq,Generic,Binary,Typeable)
78instance NFData RelationalError where rnf = genericRnf
80data PersistenceError = InvalidDirectoryError FilePath |
81 MissingTransactionError TransactionId
82 deriving (Show, Eq, Generic)
84--collapse list of errors into normal error- if there is just one, just return one
85someErrors :: [RelationalError] -> RelationalError
86someErrors [] = error "no errors in error list: function misuse"
87someErrors errList = if length errList == 1 then
90 MultipleErrors errList
92data MergeError = SelectedHeadMismatchMergeError |
93 PreferredHeadMissingMergeError HeadName |
94 StrategyViolatesConstraintMergeError |
95 InvalidMergeStrategyError MergeStrategy | -- this is an internal coding error
96 DisconnectedTransactionNotAMergeHeadError TransactionId |
97 StrategyViolatesComponentMergeError | --failed merge in inc deps, relvars, etc.
98 StrategyViolatesRelationVariableMergeError |
99 StrategyViolatesTypeConstructorMergeError
100 deriving (Show, Eq, Generic, Binary, Typeable)
102instance NFData MergeError where rnf = genericRnf
104data AtomFunctionBodyCompilationError = TypeCheckCompilationError String String | --expected, got
105 SyntaxErrorCompilationError String |
106 OtherScriptCompilationError String
107 deriving (Show,Eq, Generic, Binary, Typeable, NFData)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list