mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-08 03:18:33 +03:00
send 501 when bad resource fetched
This commit is contained in:
@@ -20,9 +20,8 @@ export default ({ config, controller }) => {
|
|||||||
.retrieveFrag(source, tab, resource, frag)
|
.retrieveFrag(source, tab, resource, frag)
|
||||||
.then(data => res.json(data))
|
.then(data => res.json(data))
|
||||||
.catch(err =>
|
.catch(err =>
|
||||||
res.json({
|
res.status(err.status || 501)
|
||||||
error: err.message
|
.send()
|
||||||
})
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -31,9 +30,8 @@ export default ({ config, controller }) => {
|
|||||||
.retrieve(req.params.source, req.params.tab, req.params.resource)
|
.retrieve(req.params.source, req.params.tab, req.params.resource)
|
||||||
.then(data => res.json(data))
|
.then(data => res.json(data))
|
||||||
.catch(err =>
|
.catch(err =>
|
||||||
res.json({
|
res.status(err.status || 501)
|
||||||
error: err.message
|
.send()
|
||||||
})
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user