Skip to content
Snippets Groups Projects
Commit 43be0517 authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: catch kginfo error

parent d0e9953d
No related branches found
No related tags found
No related merge requests found
......@@ -168,8 +168,12 @@ datasetsRouter.get('/hasPreview', cacheMaxAge24Hr, async (req, res) => {
datasetsRouter.get('/kgInfo', checkKgQuery, cacheMaxAge24Hr, async (req, res) => {
const { kgId } = req.query
const { user } = req
const stream = await getDatasetFromId({ user, kgId, returnAsStream: true })
stream.pipe(res).on('error', getHandleErrorFn(req, res))
try{
const stream = await getDatasetFromId({ user, kgId, returnAsStream: true })
stream.pipe(res).on('error', getHandleErrorFn(req, res))
}catch(e){
getHandleErrorFn(req, res)(e)
}
})
datasetsRouter.get('/downloadKgFiles', checkKgQuery, async (req, res) => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment