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