fix: address unhandled promise rejections & bump node to v16.13 (#2398)

* fix: unhandled promise rejections

* build(deps): bump node from 14.18 to 16.13

* fix: unhandled promise rejection in new Plex users endpoint

* fix: build error

Co-authored-by: Ryan Cohen <ryan@sct.dev>
This commit is contained in:
TheCatLady
2022-01-27 06:00:30 -05:00
committed by GitHub
parent ca184728e9
commit 8cba486249
20 changed files with 1328 additions and 906 deletions

View File

@@ -1,6 +1,7 @@
import { Router } from 'express';
import TheMovieDb from '../api/themoviedb';
import Media from '../entity/Media';
import logger from '../logger';
import { mapCollection } from '../models/Collection';
const collectionRoutes = Router();
@@ -20,7 +21,15 @@ collectionRoutes.get<{ id: string }>('/:id', async (req, res, next) => {
return res.status(200).json(mapCollection(collection, media));
} catch (e) {
return next({ status: 404, message: 'Collection does not exist' });
logger.debug('Something went wrong retrieving collection', {
label: 'API',
errorMessage: e.message,
collectionId: req.params.id,
});
return next({
status: 500,
message: 'Unable to retrieve collection.',
});
}
});