aboutsummaryrefslogtreecommitdiffstats
path: root/src/Data/JLD/Error.hs
diff options
context:
space:
mode:
authorVolpeon <github@volpeon.ink>2023-05-26 07:40:13 +0200
committerVolpeon <github@volpeon.ink>2023-05-26 07:40:13 +0200
commit11d0fb47c292a0ca25a9c377499d2b221d97a5cb (patch)
treee729e2a4508763b3073b7eae9a56bc9c6a9ca0f7 /src/Data/JLD/Error.hs
downloadhs-jsonld-11d0fb47c292a0ca25a9c377499d2b221d97a5cb.tar.gz
hs-jsonld-11d0fb47c292a0ca25a9c377499d2b221d97a5cb.tar.bz2
hs-jsonld-11d0fb47c292a0ca25a9c377499d2b221d97a5cb.zip
Init
Diffstat (limited to 'src/Data/JLD/Error.hs')
-rw-r--r--src/Data/JLD/Error.hs81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/Data/JLD/Error.hs b/src/Data/JLD/Error.hs
new file mode 100644
index 0000000..91c2a0b
--- /dev/null
+++ b/src/Data/JLD/Error.hs
@@ -0,0 +1,81 @@
1module Data.JLD.Error (JLDError (..), toJldErrorCode) where
2
3import Data.JLD.Prelude
4
5import Data.JLD.Model.Keyword (Keyword (KeywordType))
6
7import Data.Aeson (Value)
8
9data JLDError e
10 = InvalidKeywordValue Keyword Value
11 | ProcessingModeConflict
12 | InvalidContextEntry
13 | InvalidContextNullification
14 | InvalidLocalContext
15 | InvalidRemoteContext
16 | InvalidBaseIri
17 | InvalidVocabMapping
18 | InvalidDefaultLanguage
19 | InvalidBaseDirection
20 | LoadingRemoteContextError
21 | DocumentLoaderError e
22 | ContextOverflow
23 | InvalidTermDefinition
24 | CyclicIriMapping
25 | KeywordRedefinition
26 | InvalidTypeMapping
27 | InvalidReverseProperty
28 | InvalidIriMapping
29 | InvalidKeywordAlias
30 | InvalidContainerMapping
31 | InvalidLanguageMapping
32 | ProtectedTermRedefinition
33 | InvalidReversePropertyMap
34 | CollidingKeywords Text Keyword
35 | InvalidValueObjectValue
36 | InvalidLanguageTaggedString
37 | InvalidReversePropertyValue
38 | InvalidLanguageMapValue
39 | InvalidValueObject
40 | InvalidLanguageTaggedValue
41 | InvalidTypedValue
42 | InvalidSetOrListObject
43 | InvalidScopedContext
44 deriving (Eq, Show)
45
46toJldErrorCode :: JLDError e -> Text
47toJldErrorCode (InvalidKeywordValue KeywordType _) = "invalid type value"
48toJldErrorCode (InvalidKeywordValue keyword _) = "invalid " <> show keyword <> " value"
49toJldErrorCode ProcessingModeConflict = "processing mode conflict"
50toJldErrorCode InvalidContextEntry = "invalid context entry"
51toJldErrorCode InvalidContextNullification = "invalid context nullification"
52toJldErrorCode InvalidLocalContext = "invalid local context"
53toJldErrorCode InvalidRemoteContext = "invalid remote context"
54toJldErrorCode InvalidBaseIri = "invalid base IRI"
55toJldErrorCode InvalidVocabMapping = "invalid vocab mapping"
56toJldErrorCode InvalidDefaultLanguage = "invalid default language"
57toJldErrorCode InvalidBaseDirection = "invalid base direction"
58toJldErrorCode LoadingRemoteContextError = "loading remote context failed"
59toJldErrorCode (DocumentLoaderError _) = "loading document failed"
60toJldErrorCode ContextOverflow = "context overflow"
61toJldErrorCode InvalidTermDefinition = "invalid term definition"
62toJldErrorCode CyclicIriMapping = "cyclic IRI mapping"
63toJldErrorCode KeywordRedefinition = "keyword redefinition"
64toJldErrorCode InvalidTypeMapping = "invalid type mapping"
65toJldErrorCode InvalidReverseProperty = "invalid reverse property"
66toJldErrorCode InvalidIriMapping = "invalid IRI mapping"
67toJldErrorCode InvalidKeywordAlias = "invalid keyword alias"
68toJldErrorCode InvalidContainerMapping = "invalid container mapping"
69toJldErrorCode InvalidLanguageMapping = "invalid language mapping"
70toJldErrorCode ProtectedTermRedefinition = "protected term redefinition"
71toJldErrorCode InvalidReversePropertyMap = "invalid reverse property map"
72toJldErrorCode (CollidingKeywords _ _) = "colliding keywords"
73toJldErrorCode InvalidValueObjectValue = "invalid value object value"
74toJldErrorCode InvalidLanguageTaggedString = "invalid language-tagged string"
75toJldErrorCode InvalidReversePropertyValue = "invalid reverse property value"
76toJldErrorCode InvalidLanguageMapValue = "invalid language map value"
77toJldErrorCode InvalidValueObject = "invalid value object"
78toJldErrorCode InvalidLanguageTaggedValue = "invalid language-tagged value"
79toJldErrorCode InvalidTypedValue = "invalid typed value"
80toJldErrorCode InvalidSetOrListObject = "invalid set or list object"
81toJldErrorCode InvalidScopedContext = "invalid scoped context"