1{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
2module ProjectM36.Error where
4import ProjectM36.MerkleHash
5import ProjectM36.DatabaseContextFunctionError
6import ProjectM36.AtomFunctionError
7import qualified Data.Set as S
8import Control.DeepSeq (NFData, rnf)
9import Control.DeepSeq.Generics (genericRnf)
10import GHC.Generics (Generic)
11import qualified Data.Text as T
14import Control.Exception
16data RelationalError = NoSuchAttributeNamesError (S.Set AttributeName)
17 | TupleAttributeCountMismatchError Int --attribute name
18 | EmptyAttributesError
19 | DuplicateAttributeNamesError (S.Set AttributeName)
20 | TupleAttributeTypeMismatchError Attributes
21 | AttributeCountMismatchError Int
22 | AttributeNamesMismatchError (S.Set AttributeName)
23 | AttributeNameInUseError AttributeName
24 | AttributeIsNotRelationValuedError AttributeName
25 | CouldNotInferAttributes
26 | RelVarNotDefinedError RelVarName
27 | RelVarAlreadyDefinedError RelVarName
28 | RelationTypeMismatchError Attributes Attributes --expected, found
29 | InclusionDependencyCheckError IncDepName
30 | InclusionDependencyNameInUseError IncDepName
31 | InclusionDependencyNameNotInUseError IncDepName
33 | PredicateExpressionError T.Text
34 | NoCommonTransactionAncestorError TransactionId TransactionId
35 | NoSuchTransactionError TransactionId
36 | RootTransactionTraversalError
37 | HeadNameSwitchingHeadProhibitedError HeadName
38 | NoSuchHeadNameError HeadName
40 | NewTransactionMayNotHaveChildrenError TransactionId
41 | ParentCountTraversalError Int Int --maximum, requested
42 | NewTransactionMissingParentError TransactionId
43 | TransactionIsNotAHeadError TransactionId
44 | TransactionGraphCycleError TransactionId
45 | SessionIdInUseError TransactionId
46 | NoSuchSessionError TransactionId
47 | FailedToFindTransactionError TransactionId
48 | TransactionIdInUseError TransactionId
49 | NoSuchFunctionError AtomFunctionName
50 | NoSuchTypeConstructorName TypeConstructorName
51 | TypeConstructorAtomTypeMismatch TypeConstructorName AtomType
52 | AtomTypeMismatchError AtomType AtomType
53 | TypeConstructorNameMismatch TypeConstructorName TypeConstructorName
54 | AtomTypeTypeConstructorReconciliationError AtomType TypeConstructorName
55 | DataConstructorNameInUseError DataConstructorName
56 | DataConstructorUsesUndeclaredTypeVariable TypeVarName
57 | TypeConstructorTypeVarsMismatch (S.Set TypeVarName) (S.Set TypeVarName)
58 | TypeConstructorTypeVarMissing TypeVarName
59 | TypeConstructorTypeVarsTypesMismatch TypeConstructorName TypeVarMap TypeVarMap
60 | DataConstructorTypeVarsMismatch DataConstructorName TypeVarMap TypeVarMap
61 | AtomFunctionTypeVariableResolutionError AtomFunctionName TypeVarName
62 | AtomFunctionTypeVariableMismatch TypeVarName AtomType AtomType
63 | AtomTypeNameInUseError AtomTypeName
64 | IncompletelyDefinedAtomTypeWithConstructorError
65 | AtomTypeNameNotInUseError AtomTypeName
66 | AttributeNotSortableError Attribute
67 | FunctionNameInUseError AtomFunctionName
68 | FunctionNameNotInUseError AtomFunctionName
70 | FunctionArgumentCountMismatchError Int Int
71 | ConstructedAtomArgumentCountMismatchError Int Int
72 | NoSuchDataConstructorError DataConstructorName
73 | NoSuchTypeConstructorError TypeConstructorName
74 | InvalidAtomTypeName AtomTypeName
75 | AtomTypeNotSupported AttributeName --used by persistent driver
76 | AtomOperatorNotSupported T.Text --used by persistent driver
77 | EmptyTuplesError -- used by persistent driver
78 | AtomTypeCountError [AtomType] [AtomType]
79 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
80 | AtomFunctionUserError AtomFunctionError
81 | PrecompiledFunctionRemoveError AtomFunctionName -- pre-compiled atom functions cannot be serialized, so they cannot change over time- they are referred to in perpetuity
82 | RelationValuedAttributesNotSupportedError [AttributeName]
83 | NotificationNameInUseError NotificationName
84 | NotificationNameNotInUseError NotificationName
85 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
87 | UnhandledExceptionError String
88 | MergeTransactionError MergeError
89 | ScriptError ScriptCompilationError
91 | DatabaseContextFunctionUserError DatabaseContextFunctionError
92 | DatabaseLoadError PersistenceError
94 | SubschemaNameInUseError SchemaName
95 | SubschemaNameNotInUseError SchemaName
97 | SchemaCreationError SchemaError
99 | ImproperDatabaseStateError
101 | NonConcreteSchemaPlanError
103 | NoUncommittedContextInEvalError
104 | TupleExprsReferenceMultipleMarkersError
106 | MerkleHashValidationError TransactionId MerkleHash MerkleHash
108 | MultipleErrors [RelationalError]
109 deriving (Show,Eq,Generic,Binary,Typeable, NFData)
111data PersistenceError = InvalidDirectoryError FilePath |
112 MissingTransactionError TransactionId |
113 WrongDatabaseFormatVersionError String String
114 deriving (Show, Eq, Generic, Binary, NFData)
116--collapse list of errors into normal error- if there is just one, just return one
117someErrors :: [RelationalError] -> RelationalError
118someErrors [] = error "no errors in error list: function misuse"
119someErrors errList = if length errList == 1 then
122 MultipleErrors errList
124data MergeError = SelectedHeadMismatchMergeError |
125 PreferredHeadMissingMergeError HeadName |
126 StrategyViolatesConstraintMergeError |
127 InvalidMergeStrategyError MergeStrategy | -- this is an internal coding error
128 DisconnectedTransactionNotAMergeHeadError TransactionId |
129 StrategyViolatesComponentMergeError | --failed merge in inc deps, relvars, etc.
130 StrategyViolatesRelationVariableMergeError |
131 StrategyViolatesTypeConstructorMergeError
132 deriving (Show, Eq, Generic, Binary, Typeable)
134instance NFData MergeError where rnf = genericRnf
136data ScriptCompilationError = TypeCheckCompilationError String String | --expected, got
137 SyntaxErrorCompilationError String |
138 ScriptCompilationDisabledError |
139 OtherScriptCompilationError String
140 deriving (Show, Eq, Generic, Binary, Typeable, NFData)
142instance Exception ScriptCompilationError
144data SchemaError = RelVarReferencesMissing (S.Set RelVarName) |
145 RelVarInReferencedMoreThanOnce RelVarName |
146 RelVarOutReferencedMoreThanOnce RelVarName
147 deriving (Show, Eq, Generic, Binary, Typeable, NFData)
150-- errors returned from the distributed-process call handlers
151data ServerError = RequestTimeoutError |
152 ProcessDiedError String
153 deriving (Generic, Binary, Eq)
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