fix: return 400 for invalid ID instead of raising Error

This commit is contained in:
WebStreamr 2025-12-22 10:21:24 +00:00
parent 9fd563450e
commit 0610b8556a
No known key found for this signature in database

View file

@ -35,7 +35,9 @@ export class StreamController {
} else if (rawId.startsWith('tt')) {
id = ImdbId.fromString(rawId);
} else {
throw new Error(`Unsupported ID: ${rawId}`);
res.status(400).send(`Unsupported ID: ${rawId}`);
return;
}
const ctx = contextFromRequestAndResponse(req, res);