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 | ParentCountTraversalError Int Int --maximum, requested
35 | NewTransactionMissingParentError TransactionId
36 | TransactionIsNotAHeadError TransactionId
37 | TransactionGraphCycleError TransactionId
38 | SessionIdInUseError TransactionId
39 | NoSuchSessionError TransactionId
40 | FailedToFindTransactionError TransactionId
41 | TransactionIdInUseError TransactionId
42 | NoSuchTupleExprFunctionError AtomFunctionName
43 | NoSuchTypeConstructorName TypeConstructorName
44 | TypeConstructorAtomTypeMismatch TypeConstructorName AtomType
45 | AtomTypeMismatchError AtomType AtomType
46 | TypeConstructorNameMismatch TypeConstructorName TypeConstructorName
47 | AtomTypeTypeConstructorReconciliationError AtomType TypeConstructorName
48 | DataConstructorNameInUseError DataConstructorName
49 | DataConstructorUsesUndeclaredTypeVariable TypeVarName
50 | TypeConstructorTypeVarsMismatch (S.Set TypeVarName) (S.Set TypeVarName)
51 | TypeConstructorTypeVarMissing TypeVarName
52 | TypeConstructorTypeVarsTypesMismatch TypeConstructorName TypeVarMap TypeVarMap
53 | DataConstructorTypeVarsMismatch DataConstructorName TypeVarMap TypeVarMap
54 | AtomTypeNameInUseError AtomTypeName
55 | IncompletelyDefinedAtomTypeWithConstructorError
56 | AtomTypeNameNotInUseError AtomTypeName
57 | AtomFunctionNameInUseError AtomFunctionName
58 | AtomFunctionNameNotInUseError AtomFunctionName
59 | AtomFunctionArgumentCountMismatch Int Int
60 | NoSuchDataConstructorError DataConstructorName
61 | NoSuchTypeConstructorError TypeConstructorName
62 | InvalidAtomTypeName AtomTypeName
63 | AtomTypeNotSupported AttributeName --used by persistent driver
64 | AtomOperatorNotSupported T.Text --used by persistent driver
65 | EmptyTuplesError -- used by persistent driver
66 | AtomTypeCountError [AtomType] [AtomType]
67 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
68 | RelationValuedAttributesNotSupportedError [AttributeName]
69 | NotificationNameInUseError NotificationName
70 | NotificationNameNotInUseError NotificationName
71 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
73 | UnhandledExceptionError String
74 | MergeTransactionError MergeError
75 | AtomFunctionBodyScriptError AtomFunctionBodyCompilationError
76 | MultipleErrors [RelationalError]
77 deriving (Show,Eq,Generic,Binary,Typeable)
79instance NFData RelationalError where rnf = genericRnf
81data PersistenceError = InvalidDirectoryError FilePath |
82 MissingTransactionError TransactionId
83 deriving (Show, Eq, Generic)
85--collapse list of errors into normal error- if there is just one, just return one
86someErrors :: [RelationalError] -> RelationalError
87someErrors [] = error "no errors in error list: function misuse"
88someErrors errList = if length errList == 1 then
91 MultipleErrors errList
93data MergeError = SelectedHeadMismatchMergeError |
94 PreferredHeadMissingMergeError HeadName |
95 StrategyViolatesConstraintMergeError |
96 InvalidMergeStrategyError MergeStrategy | -- this is an internal coding error
97 DisconnectedTransactionNotAMergeHeadError TransactionId |
98 StrategyViolatesComponentMergeError | --failed merge in inc deps, relvars, etc.
99 StrategyViolatesRelationVariableMergeError |
100 StrategyViolatesTypeConstructorMergeError
101 deriving (Show, Eq, Generic, Binary, Typeable)
103instance NFData MergeError where rnf = genericRnf
105data AtomFunctionBodyCompilationError = TypeCheckCompilationError String String | --expected, got
106 SyntaxErrorCompilationError String |
107 ScriptCompilationDisabledError |
108 OtherScriptCompilationError String
109 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