skipSegments return 400 if bad categories

This commit is contained in:
Michael C
2021-06-15 23:01:26 -04:00
parent 87c6dab41d
commit 0a8f7aa39d
2 changed files with 11 additions and 1 deletions

View File

@@ -306,7 +306,9 @@ async function endpoint(req: Request, res: Response): Promise<void> {
res.send(segments);
}
} catch (err) {
res.status(500).send();
if (err instanceof SyntaxError) {
res.status(400).send("Categories parameter does not match format requirements.");
} else res.status(500).send();
}
}