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
94f40500
Commit
94f40500
authored
Jul 22, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[server] 404 error when nodes don't exist
parent
e841d483
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
Server.hs
src/Gargantext/API/Server.hs
+8
-1
Error.hs
src/Gargantext/Database/Query/Table/Node/Error.hs
+1
-1
No files found.
src/Gargantext/API/Server.hs
View file @
94f40500
...
...
@@ -8,6 +8,7 @@ Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
---------------------------------------------------------------------
...
...
@@ -32,9 +33,10 @@ import Gargantext.API.Prelude
import
Gargantext.API.Routes
import
Gargantext.API.Swagger
(
swaggerDoc
)
import
Gargantext.API.ThrowAll
(
serverPrivateGargAPI
)
import
Gargantext.Database.Query.Table.Node.Error
(
NodeError
(
..
))
import
Gargantext.Database.Prelude
(
hasConfig
)
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
gc_url_backend_api
)
import
Gargantext.Database.Prelude
(
hasConfig
)
serverGargAPI
::
MimeRender
JSON
err
=>
Text
->
GargServerM
env
err
GargAPI
...
...
@@ -66,5 +68,10 @@ server env = do
showAsServantErr
::
GargError
->
ServerError
showAsServantErr
(
GargNodeError
err
@
NoListFound
)
=
err404
{
errBody
=
BL8
.
pack
$
show
err
}
showAsServantErr
(
GargNodeError
err
@
NoRootFound
)
=
err404
{
errBody
=
BL8
.
pack
$
show
err
}
showAsServantErr
(
GargNodeError
err
@
NoCorpusFound
)
=
err404
{
errBody
=
BL8
.
pack
$
show
err
}
showAsServantErr
(
GargNodeError
err
@
NoUserFound
)
=
err404
{
errBody
=
BL8
.
pack
$
show
err
}
showAsServantErr
(
GargNodeError
err
@
(
DoesNotExist
_
))
=
err404
{
errBody
=
BL8
.
pack
$
show
err
}
showAsServantErr
(
GargServerError
err
)
=
err
showAsServantErr
a
=
err500
{
errBody
=
BL8
.
pack
$
show
a
}
src/Gargantext/Database/Query/Table/Node/Error.hs
View file @
94f40500
...
...
@@ -49,7 +49,7 @@ instance Show NodeError
show
NotImplYet
=
"Not implemented yet"
show
ManyParents
=
"Too many parents"
show
ManyNodeUsers
=
"Many userNode/user"
show
(
DoesNotExist
n
)
=
"Node does not exist
"
<>
show
n
show
(
DoesNotExist
n
)
=
"Node does not exist
("
<>
show
n
<>
")"
show
NeedsConfiguration
=
"Needs configuration"
show
(
NodeError
e
)
=
"NodeError: "
<>
cs
e
...
...
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