[cli][node] make error handling of edge functions consistent with serverless functions in vc dev (#8007)

When edge functions error, they were showing a basic text response instead of the error template. They were also sending a 502 status code instead of a 500.

This PR makes the error handling of Edge Functions consistent with Serverless Functions when executed through `vc dev`. If we want to update the error templates themselves, we can do that in a separate PR.

**Note:** Production currently treats Edge Function errors differently from Serverless Function errors, but that's a known issue that will be resolved.

---

*I deleted the original outputs (terminal and browser screenshots) because they are out of date and added a lot of content to this page. See my latest comment for updated examples.*
This commit is contained in:
Sean Massa
2022-06-27 23:12:21 -05:00
committed by GitHub
parent 4f832acf90
commit 3ece7ac969
16 changed files with 511 additions and 102 deletions

View File

@@ -257,6 +257,10 @@ async function testFixture(directory, opts = {}, args = []) {
dev.kill = async (...args) => {
dev._kill(...args);
await exitResolver;
return {
stdout,
stderr,
};
};
return {