Skip to content

Commit 0521e71

Browse files
committed
Emit errors as text response to the client
1 parent dc9d562 commit 0521e71

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

pages/api/generate-css.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,20 @@ export default async function handler(
6262

6363
//
6464
} else {
65-
res.status(500).send(error.toString());
65+
res
66+
.status(200)
67+
.send(error.reason || error.toString() || "500 Server Error");
6668
doneProcessing = true;
6769
}
6870

6971
//
7072
} else {
71-
res.status(500).send(error.toString());
73+
res
74+
.status(200)
75+
.send(
76+
(error ? error.reason || error.toString() : "") ||
77+
"500 Server Error"
78+
);
7279
doneProcessing = true;
7380
}
7481
}

0 commit comments

Comments
 (0)