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 | AttributeNotSortableError Attribute
66 | FunctionNameInUseError AtomFunctionName
67 | FunctionNameNotInUseError AtomFunctionName
69 | FunctionArgumentCountMismatchError Int Int
70 | ConstructedAtomArgumentCountMismatchError Int Int
71 | NoSuchDataConstructorError DataConstructorName
72 | NoSuchTypeConstructorError TypeConstructorName
73 | InvalidAtomTypeName AtomTypeName
74 | AtomTypeNotSupported AttributeName --used by persistent driver
75 | AtomOperatorNotSupported T.Text --used by persistent driver
76 | EmptyTuplesError -- used by persistent driver
77 | AtomTypeCountError [AtomType] [AtomType]
78 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
79 | AtomFunctionUserError AtomFunctionError
80 | PrecompiledFunctionRemoveError AtomFunctionName -- pre-compiled atom functions cannot be serialized, so they cannot change over time- they are referred to in perpetuity
81 | RelationValuedAttributesNotSupportedError [AttributeName]
82 | NotificationNameInUseError NotificationName
83 | NotificationNameNotInUseError NotificationName
84 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
86 | UnhandledExceptionError String
87 | MergeTransactionError MergeError
88 | ScriptError ScriptCompilationError
90 | DatabaseContextFunctionUserError DatabaseContextFunctionError
91 | DatabaseLoadError PersistenceError
93 | SubschemaNameInUseError SchemaName
94 | SubschemaNameNotInUseError SchemaName
96 | SchemaCreationError SchemaError
98 | ImproperDatabaseStateError
100 | NonConcreteSchemaPlanError
102 | NoUncommittedContextInEvalError
104 | MultipleErrors [RelationalError]
105 deriving (Show,Eq,Generic,Binary,Typeable, NFData)
107data PersistenceError = InvalidDirectoryError FilePath |
108 MissingTransactionError TransactionId |
109 WrongDatabaseFormatVersionError String String
110 deriving (Show, Eq, Generic, Binary, NFData)
112--collapse list of errors into normal error- if there is just one, just return one
113someErrors :: [RelationalError] -> RelationalError
114someErrors [] = error "no errors in error list: function misuse"
115someErrors errList = if length errList == 1 then
118 MultipleErrors errList
120data MergeError = SelectedHeadMismatchMergeError |
121 PreferredHeadMissingMergeError HeadName |
122 StrategyViolatesConstraintMergeError |
123 InvalidMergeStrategyError MergeStrategy | -- this is an internal coding error
124 DisconnectedTransactionNotAMergeHeadError TransactionId |
125 StrategyViolatesComponentMergeError | --failed merge in inc deps, relvars, etc.
126 StrategyViolatesRelationVariableMergeError |
127 StrategyViolatesTypeConstructorMergeError
128 deriving (Show, Eq, Generic, Binary, Typeable)
130instance NFData MergeError where rnf = genericRnf
132data ScriptCompilationError = TypeCheckCompilationError String String | --expected, got
133 SyntaxErrorCompilationError String |
134 ScriptCompilationDisabledError |
135 OtherScriptCompilationError String
136 deriving (Show, Eq, Generic, Binary, Typeable, NFData)
138instance Exception ScriptCompilationError
140data SchemaError = RelVarReferencesMissing (S.Set RelVarName) |
141 RelVarInReferencedMoreThanOnce RelVarName |
142 RelVarOutReferencedMoreThanOnce RelVarName
143 deriving (Show, Eq, Generic, Binary, Typeable, NFData)
146-- errors returned from the distributed-process call handlers
147data ServerError = RequestTimeoutError |
148 ProcessDiedError String
149 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