mirror of
https://github.com/withastro/astro.git
synced 2025-02-24 22:46:02 -05:00
fix(errors): Remove duplicate logging of errors (#10197)
* fix(errors): Remove duplicate logging of errors * chore: changeset
This commit is contained in:
parent
598f30c7cd
commit
c856c72940
2 changed files with 7 additions and 3 deletions
5
.changeset/light-masks-watch.md
Normal file
5
.changeset/light-masks-watch.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Fixes errors being logged twice in some cases
|
|
@ -83,9 +83,8 @@ export async function writeWebResponse(res: http.ServerResponse, webResponse: Re
|
|||
} else {
|
||||
const reader = body.getReader();
|
||||
res.on('close', () => {
|
||||
reader.cancel().catch((error: unknown) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('An unexpected error occurred in the middle of the stream.', error);
|
||||
reader.cancel().catch(() => {
|
||||
// Don't log here, or errors will get logged twice in most cases
|
||||
});
|
||||
});
|
||||
while (true) {
|
||||
|
|
Loading…
Add table
Reference in a new issue