Fix unhandled rejection

This commit is contained in:
Calvin Montgomery 2017-08-14 20:31:45 -07:00
parent c6c3bafca2
commit 99076412b6
1 changed files with 10 additions and 6 deletions

View File

@ -19,12 +19,16 @@ export default function initialize(app, session) {
let rank; let rank;
if (!global_rank) { if (!global_rank) {
rank = await backfillRankIntoAuthCookie( try {
session, rank = await backfillRankIntoAuthCookie(
new Date(parseInt(expiration, 10)), session,
req, new Date(parseInt(expiration, 10)),
res req,
); res
);
} catch (error) {
return next();
}
} else { } else {
rank = parseInt(global_rank, 10); rank = parseInt(global_rank, 10);
} }