mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
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:
@@ -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.',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user