fix: return 400 for invalid ID instead of raising Error
This commit is contained in:
parent
9fd563450e
commit
0610b8556a
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue