itterated on copy

This commit is contained in:
Wyatt Johnson
2018-04-13 18:24:46 -06:00
parent 392d7177f6
commit 12bb886032
14 changed files with 158 additions and 78 deletions
@@ -5,6 +5,7 @@ const { get, pick, kebabCase } = require('lodash');
const moment = require('moment');
const archiver = require('archiver');
const stringify = require('csv-stringify');
const { ErrDownloadToken } = require('./errors');
async function verifyDownloadToken(
{ connectors: { services: { Users } } },
@@ -109,10 +110,7 @@ module.exports = router => {
// Verify the token
await verifyDownloadToken(req.context, token);
} catch (err) {
// Log out the error, slurp it and send out the predefined error to the
// error handler.
console.error(err);
return next(new Error('invalid token'));
return next(new ErrDownloadToken(err));
}
res.status(204).end();