0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

send a 400 instead of a 500

This commit is contained in:
Rich Harris 2019-07-02 13:31:33 -04:00
parent 80bf0fd152
commit bdda83fb74

View File

@ -9,7 +9,7 @@ export function get(req, res) {
setTimeout(() => {
// fail sometimes
if (Math.random() < 0.333) {
res.statusCode = 500;
res.statusCode = 400;
res.end(`Failed to generate random number. Please try again`);
return;
}