add ignore next to catch errors

This commit is contained in:
Michael C
2022-09-25 03:29:31 -04:00
parent 8562dc2240
commit 506b6570f3
17 changed files with 34 additions and 33 deletions

View File

@@ -107,7 +107,7 @@ async function getSegmentsByVideoID(req: Request, videoID: VideoID, categories:
}
return processedSegments;
} catch (err) {
} catch (err) /* istanbul ignore next */ {
if (err) {
Logger.error(err as string);
return null;
@@ -169,7 +169,7 @@ async function getSegmentsByHash(req: Request, hashedVideoIDPrefix: VideoIDHash,
}));
return segments;
} catch (err) {
} catch (err) /* istanbul ignore next */ {
Logger.error(err as string);
return null;
}
@@ -465,7 +465,7 @@ async function endpoint(req: Request, res: Response): Promise<Response> {
//send result
return res.send(segments);
}
} catch (err) {
} catch (err) /* istanbul ignore next */ {
if (err instanceof SyntaxError) {
return res.status(400).send("Categories parameter does not match format requirements.");
} else return res.sendStatus(500);