Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
34efdd82
Commit
34efdd82
authored
Sep 14, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DOC] better error messages
parent
39b9ed39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Root.hs
src/Gargantext/Database/Query/Tree/Root.hs
+4
-4
No files found.
src/Gargantext/Database/Query/Tree/Root.hs
View file @
34efdd82
...
...
@@ -40,11 +40,11 @@ import Opaleye (restrict, (.==), Query)
import
Opaleye.PGTypes
(
pgStrictText
,
pgInt4
)
getRootId
::
User
->
Cmd
err
NodeId
getRootId
::
(
HasNodeError
err
)
=>
User
->
Cmd
err
NodeId
getRootId
u
=
do
maybeRoot
<-
head
<$>
getRoot
u
case
maybeRoot
of
Nothing
->
panic
"n
o root id"
Nothing
->
nodeError
$
NodeError
"[G.D.Q.T.R.getRootId] N
o root id"
Just
r
->
pure
(
_node_id
r
)
getRoot
::
User
->
Cmd
err
[
Node
HyperdataUser
]
...
...
@@ -88,7 +88,7 @@ getOrMk_RootWithCorpus user cName c = do
else
do
c'
<-
mk
(
Just
$
fromLeft
"Default"
cName
)
c
rootId
userId
_tId
<-
case
head
c'
of
Nothing
->
pure
[
0
]
Nothing
->
nodeError
$
NodeError
"[G.D.Q.T.Root.getOrMk...] mk Corpus failed"
Just
c''
->
insertDefaultNode
NodeTexts
c''
userId
pure
c'
...
...
@@ -143,4 +143,4 @@ selectRoot (RootId nid) =
restrict
-<
_node_typename
row
.==
(
pgInt4
$
nodeTypeId
NodeUser
)
restrict
-<
_node_id
row
.==
(
pgNodeId
nid
)
returnA
-<
row
selectRoot
UserPublic
=
panic
"
No root for Public"
selectRoot
UserPublic
=
panic
{-nodeError $ NodeError-}
"[G.D.Q.T.Root.selectRoot]
No root for Public"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment