some logging cleanup

This commit is contained in:
Will Murphy 2019-09-30 20:55:20 -05:00
parent 5726e07f13
commit 26eee3c27a
8 changed files with 13 additions and 13 deletions

View file

@ -35,7 +35,7 @@ async function verifySignature (req, res, next) {
} }
next() next()
} catch (err) { } catch (err) {
console.log('error during signature verification', err) console.log('error during signature verification', err.message)
return res.status(500).send() return res.status(500).send()
} }
} }

View file

@ -42,7 +42,7 @@ function deliver (actor, activity, addresses) {
body: pubUtils.toJSONLD(activity) body: pubUtils.toJSONLD(activity)
}) })
.then(result => console.log('delivery:', addr, result.statusCode)) .then(result => console.log('delivery:', addr, result.statusCode))
.catch(err => console.log(err)) .catch(err => console.log(err.message))
}) })
return Promise.all(requests) return Promise.all(requests)
} }

View file

@ -42,7 +42,7 @@ router.post('/', net.validators.activity, net.security.verifySignature, function
break break
case 'Undo': case 'Undo':
pub.activity.undo(req.body.object, req.body.actor) pub.activity.undo(req.body.object, req.body.actor)
.catch(err => console.log(err)) .catch(err => console.log(err.message))
break break
} }
const tasks = [] const tasks = []
@ -54,7 +54,7 @@ router.post('/', net.validators.activity, net.security.verifySignature, function
} }
Promise.all(tasks).then(() => res.status(200).send()) Promise.all(tasks).then(() => res.status(200).send())
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
res.status(500).send() res.status(500).send()
}) })
}) })
@ -68,7 +68,7 @@ router.get('/', function (req, res) {
.toArray() .toArray()
.then(stream => res.json(pub.utils.arrayToCollection(stream, true))) .then(stream => res.json(pub.utils.arrayToCollection(stream, true)))
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
return res.status(500).send() return res.status(500).send()
}) })
}) })

View file

@ -17,7 +17,7 @@ router.get('/:name', function (req, res) {
return res.status(404).send('Object not found') return res.status(404).send('Object not found')
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
res.status(500).send() res.status(500).send()
}) })
} }

View file

@ -11,7 +11,7 @@ router.post('/', net.security.auth, net.validators.outboxActivity, function (req
}) })
.then(() => res.status(200).send()) .then(() => res.status(200).send())
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
res.status(500).send() res.status(500).send()
}) })
}) })
@ -25,7 +25,7 @@ router.get('/', function (req, res) {
.toArray() .toArray()
.then(stream => res.json(pub.utils.arrayToCollection(stream, true))) .then(stream => res.json(pub.utils.arrayToCollection(stream, true)))
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
return res.status(500).send() return res.status(500).send()
}) })
}) })

View file

@ -17,7 +17,7 @@ router.get('/:name', function (req, res) {
return res.status(404).send('Activity not found') return res.status(404).send('Activity not found')
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
res.status(500).send() res.status(500).send()
}) })
} }

View file

@ -15,7 +15,7 @@ router.get('/:name', net.validators.jsonld, function (req, res) {
return res.json(pub.utils.toJSONLD(group)) return res.json(pub.utils.toJSONLD(group))
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
res.status(500).send(`Error creating group ${name}`) res.status(500).send(`Error creating group ${name}`)
}) })
}) })
@ -32,7 +32,7 @@ router.get('/:name', function (req, res) {
return res.render('group.html', { group, groupAcct }) return res.render('group.html', { group, groupAcct })
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
res.status(500).send(`Error creating group ${name}`) res.status(500).send(`Error creating group ${name}`)
}) })
}) })
@ -55,7 +55,7 @@ router.get('/:name/followers', net.validators.jsonld, function (req, res) {
return res.json(pub.utils.arrayToCollection(followers)) return res.json(pub.utils.arrayToCollection(followers))
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
return res.status(500).send() return res.status(500).send()
}) })
}) })

View file

@ -32,7 +32,7 @@ router.get('/', function (req, res) {
return res.json(finger) return res.json(finger)
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err.message)
res.status(500).send() res.status(500).send()
}) })
}) })