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:
parent
80bf0fd152
commit
bdda83fb74
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user