Skip to content

Commit

Permalink
chore: clarify writableEnded guard comment (#7256)
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Mar 10, 2022
1 parent 7dcf370 commit dddda1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/server/middlewares/transform.ts
Expand Up @@ -187,8 +187,8 @@ export function transformMiddleware(
}
} catch (e) {
if (e?.code === ERR_OPTIMIZE_DEPS_PROCESSING_ERROR) {
// Skip if response has already been sent
if (!res.writableEnded) {
// Don't do anything if response has already been sent
res.statusCode = 504 // status code request timeout
res.end()
}
Expand All @@ -197,8 +197,8 @@ export function transformMiddleware(
return
}
if (e?.code === ERR_OUTDATED_OPTIMIZED_DEP) {
// Skip if response has already been sent
if (!res.writableEnded) {
// Don't do anything if response has already been sent
res.statusCode = 504 // status code request timeout
res.end()
}
Expand Down

0 comments on commit dddda1e

Please sign in to comment.