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 | TupleAttributeTypeMismatchError Attributes
18 | AttributeCountMismatchError Int
19 | AttributeNamesMismatchError (S.Set AttributeName)
20 | AttributeNameInUseError AttributeName
21 | AttributeIsNotRelationValuedError AttributeName
22 | CouldNotInferAttributes
23 | RelVarNotDefinedError RelVarName
24 | RelVarAlreadyDefinedError RelVarName
25 | RelVarAssignmentTypeMismatchError Attributes Attributes --expected, found
26 | InclusionDependencyCheckError IncDepName
27 | InclusionDependencyNameInUseError IncDepName
28 | InclusionDependencyNameNotInUseError IncDepName
30 | PredicateExpressionError T.Text
31 | NoCommonTransactionAncestorError TransactionId TransactionId
32 | NoSuchTransactionError TransactionId
33 | RootTransactionTraversalError
34 | HeadNameSwitchingHeadProhibitedError HeadName
35 | NoSuchHeadNameError HeadName
37 | NewTransactionMayNotHaveChildrenError TransactionId
38 | ParentCountTraversalError Int Int --maximum, requested
39 | NewTransactionMissingParentError TransactionId
40 | TransactionIsNotAHeadError TransactionId
41 | TransactionGraphCycleError TransactionId
42 | SessionIdInUseError TransactionId
43 | NoSuchSessionError TransactionId
44 | FailedToFindTransactionError TransactionId
45 | TransactionIdInUseError TransactionId
46 | NoSuchFunctionError AtomFunctionName
47 | NoSuchTypeConstructorName TypeConstructorName
48 | TypeConstructorAtomTypeMismatch TypeConstructorName AtomType
49 | AtomTypeMismatchError AtomType AtomType
50 | TypeConstructorNameMismatch TypeConstructorName TypeConstructorName
51 | AtomTypeTypeConstructorReconciliationError AtomType TypeConstructorName
52 | DataConstructorNameInUseError DataConstructorName
53 | DataConstructorUsesUndeclaredTypeVariable TypeVarName
54 | TypeConstructorTypeVarsMismatch (S.Set TypeVarName) (S.Set TypeVarName)
55 | TypeConstructorTypeVarMissing TypeVarName
56 | TypeConstructorTypeVarsTypesMismatch TypeConstructorName TypeVarMap TypeVarMap
57 | DataConstructorTypeVarsMismatch DataConstructorName TypeVarMap TypeVarMap
58 | AtomFunctionTypeVariableResolutionError AtomFunctionName TypeVarName
59 | AtomFunctionTypeVariableMismatch TypeVarName AtomType AtomType
60 | AtomTypeNameInUseError AtomTypeName
61 | IncompletelyDefinedAtomTypeWithConstructorError
62 | AtomTypeNameNotInUseError AtomTypeName
63 | FunctionNameInUseError AtomFunctionName
64 | FunctionNameNotInUseError AtomFunctionName
66 | FunctionArgumentCountMismatch Int Int
67 | NoSuchDataConstructorError DataConstructorName
68 | NoSuchTypeConstructorError TypeConstructorName
69 | InvalidAtomTypeName AtomTypeName
70 | AtomTypeNotSupported AttributeName --used by persistent driver
71 | AtomOperatorNotSupported T.Text --used by persistent driver
72 | EmptyTuplesError -- used by persistent driver
73 | AtomTypeCountError [AtomType] [AtomType]
74 | AtomFunctionTypeError AtomFunctionName Int AtomType AtomType --arg number
75 | AtomFunctionUserError AtomFunctionError
76 | PrecompiledFunctionRemoveError AtomFunctionName -- pre-compiled atom functions cannot be serialized, so they cannot change over time- they are referred to in perpetuity
77 | RelationValuedAttributesNotSupportedError [AttributeName]
78 | NotificationNameInUseError NotificationName
79 | NotificationNameNotInUseError NotificationName
80 | ImportError T.Text -- really? This should be broken out into some other error type- this has nothing to do with relational algebra
82 | UnhandledExceptionError String
83 | MergeTransactionError MergeError
84 | ScriptError ScriptCompilationError
85 | DatabaseContextFunctionUserError DatabaseContextFunctionError
86 | DatabaseLoadError PersistenceError
88 | SubschemaNameInUseError SchemaName
89 | SubschemaNameNotInUseError SchemaName
91 | SchemaCreationError SchemaError
93 | ImproperDatabaseStateError
95 | MultipleErrors [RelationalError]
96 deriving (Show,Eq,Generic,Binary,Typeable, NFData)
98data PersistenceError = InvalidDirectoryError FilePath |
99 MissingTransactionError TransactionId |
100 WrongDatabaseFormatVersionError String String
101 deriving (Show, Eq, Generic, Binary, NFData)
103--collapse list of errors into normal error- if there is just one, just return one
104someErrors :: [RelationalError] -> RelationalError
105someErrors [] = error "no errors in error list: function misuse"
106someErrors errList = if length errList == 1 then
109 MultipleErrors errList
111data MergeError = SelectedHeadMismatchMergeError |
112 PreferredHeadMissingMergeError HeadName |
113 StrategyViolatesConstraintMergeError |
114 InvalidMergeStrategyError MergeStrategy | -- this is an internal coding error
115 DisconnectedTransactionNotAMergeHeadError TransactionId |
116 StrategyViolatesComponentMergeError | --failed merge in inc deps, relvars, etc.
117 StrategyViolatesRelationVariableMergeError |
118 StrategyViolatesTypeConstructorMergeError
119 deriving (Show, Eq, Generic, Binary, Typeable)
121instance NFData MergeError where rnf = genericRnf
123data ScriptCompilationError = TypeCheckCompilationError String String | --expected, got
124 SyntaxErrorCompilationError String |
125 ScriptCompilationDisabledError |
126 OtherScriptCompilationError String
127 deriving (Show, Eq, Generic, Binary, Typeable, NFData)
129instance Exception ScriptCompilationError
131data SchemaError = RelVarReferencesMissing (S.Set RelVarName) |
132 RelVarInReferencedMoreThanOnce RelVarName |
133 RelVarOutReferencedMoreThanOnce RelVarName
134 deriving (Show, Eq, Generic, Binary, Typeable, NFData)
137-- errors returned from the distributed-process call handlers
138data ServerError = RequestTimeoutError |
139 ProcessDiedError String
140 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