Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
604e05aa
Commit
604e05aa
authored
5 years ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: proper error catching in node backend
parent
13bbc3bf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
deploy/app.js
+3
-3
3 additions, 3 deletions
deploy/app.js
deploy/catchError.js
+1
-1
1 addition, 1 deletion
deploy/catchError.js
deploy/datasets/index.js
+3
-4
3 additions, 4 deletions
deploy/datasets/index.js
with
7 additions
and
8 deletions
deploy/app.js
+
3
−
3
View file @
604e05aa
...
...
@@ -38,9 +38,6 @@ app.use(session({
*/
configureAuth
(
app
)
const
catchError
=
require
(
'
./catchError
'
)
app
.
use
(
catchError
)
const
publicPath
=
process
.
env
.
NODE_ENV
===
'
production
'
?
path
.
join
(
__dirname
,
'
public
'
)
:
path
.
join
(
__dirname
,
'
..
'
,
'
dist
'
,
'
aot
'
)
...
...
@@ -61,4 +58,7 @@ app.use('/nehubaConfig', nehubaConfigRouter)
app
.
use
(
'
/datasets
'
,
datasetRouter
)
app
.
use
(
'
/plugins
'
,
pluginRouter
)
const
catchError
=
require
(
'
./catchError
'
)
app
.
use
(
catchError
)
module
.
exports
=
app
\ No newline at end of file
This diff is collapsed.
Click to expand it.
deploy/catchError.js
+
1
−
1
View file @
604e05aa
...
...
@@ -7,5 +7,5 @@ module.exports = ({code = 500, error = 'an error had occured', trace = 'undefine
error
,
trace
})
res
.
s
endS
tatus
(
code
)
res
.
status
(
code
)
.
send
()
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
deploy/datasets/index.js
+
3
−
4
View file @
604e05aa
...
...
@@ -18,8 +18,7 @@ datasetsRouter.get('/templateName/:templateName', (req, res, next) => {
const
{
user
}
=
req
getDatasets
({
templateName
,
user
})
.
then
(
ds
=>
{
const
data
=
JSON
.
stringify
(
ds
)
res
.
status
(
200
).
send
(
data
)
res
.
status
(
200
).
json
(
ds
)
})
.
catch
(
error
=>
{
next
({
...
...
@@ -35,7 +34,7 @@ datasetsRouter.get('/parcellationName/:parcellationName', (req, res, next) => {
const
{
user
}
=
req
getDatasets
({
parcellationName
,
user
})
.
then
(
ds
=>
{
res
.
status
(
200
).
send
(
JSON
.
stringify
(
ds
)
)
res
.
status
(
200
).
json
(
ds
)
})
.
catch
(
error
=>
{
next
({
...
...
@@ -51,7 +50,7 @@ datasetsRouter.get('/preview/:datasetName', (req, res, next) => {
getPreview
({
datasetName
})
.
then
(
preview
=>
{
if
(
preview
)
{
res
.
status
(
200
).
send
(
JSON
.
stringify
(
preview
)
)
res
.
status
(
200
).
json
(
preview
)
}
else
{
next
({
code
:
404
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment