Reverted the update
Some checks failed
Auto Maintenance Cycle / pre-commit Autoupdate (push) Failing after 31s

This commit is contained in:
2024-05-21 02:29:28 +02:00
parent 5677567dc9
commit d1250e341b
37 changed files with 312 additions and 778 deletions

View File

@ -230,9 +230,9 @@ class Request {
onBodySent (chunk) {
if (this[kHandler].onBodySent) {
try {
return this[kHandler].onBodySent(chunk)
this[kHandler].onBodySent(chunk)
} catch (err) {
this.abort(err)
this.onError(err)
}
}
}
@ -244,9 +244,9 @@ class Request {
if (this[kHandler].onRequestSent) {
try {
return this[kHandler].onRequestSent()
this[kHandler].onRequestSent()
} catch (err) {
this.abort(err)
this.onError(err)
}
}
}
@ -271,23 +271,14 @@ class Request {
channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })
}
try {
return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
} catch (err) {
this.abort(err)
}
return this[kHandler].onHeaders(statusCode, headers, resume, statusText)
}
onData (chunk) {
assert(!this.aborted)
assert(!this.completed)
try {
return this[kHandler].onData(chunk)
} catch (err) {
this.abort(err)
return false
}
return this[kHandler].onData(chunk)
}
onUpgrade (statusCode, headers, socket) {
@ -306,13 +297,7 @@ class Request {
if (channels.trailers.hasSubscribers) {
channels.trailers.publish({ request: this, trailers })
}
try {
return this[kHandler].onComplete(trailers)
} catch (err) {
// TODO (fix): This might be a bad idea?
this.onError(err)
}
return this[kHandler].onComplete(trailers)
}
onError (error) {
@ -326,7 +311,6 @@ class Request {
return
}
this.aborted = true
return this[kHandler].onError(error)
}