send 501 when bad resource fetched

This commit is contained in:
Lachie Kermode
2018-11-19 14:24:42 +00:00
parent 4da9328588
commit a4639b8bf7

View File

@@ -20,9 +20,8 @@ export default ({ config, controller }) => {
.retrieveFrag(source, tab, resource, frag)
.then(data => res.json(data))
.catch(err =>
res.json({
error: err.message
})
res.status(err.status || 501)
.send()
)
})
@@ -31,9 +30,8 @@ export default ({ config, controller }) => {
.retrieve(req.params.source, req.params.tab, req.params.resource)
.then(data => res.json(data))
.catch(err =>
res.json({
error: err.message
})
res.status(err.status || 501)
.send()
)
})