Update next-connect middleware to return next() to fix error handling

This commit is contained in:
Aaron William Po
2023-07-17 15:44:32 -04:00
parent 8ed798ce60
commit bfbf7c3cf3
9 changed files with 167 additions and 50 deletions

View File

@@ -12,7 +12,7 @@ async function sendEditBeerPostRequest(
});
if (!response.ok) {
throw new Error('something went wrong');
throw new Error(`${response.status}: ${response.statusText}`);
}
const json = await response.json();