Skip to content

Commit

Permalink
fix: bad error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 22, 2023
1 parent 039fa15 commit e495094
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,7 @@ class Request {

onBodySent (chunk) {
if (this[kHandler].onBodySent) {
try {
this[kHandler].onBodySent(chunk)
} catch (err) {
this.onError(err)
}
return this[kHandler].onBodySent(chunk)
}
}

Expand All @@ -243,11 +239,7 @@ class Request {
}

if (this[kHandler].onRequestSent) {
try {
this[kHandler].onRequestSent()
} catch (err) {
this.onError(err)
}
return this[kHandler].onRequestSent()
}
}

Expand Down

0 comments on commit e495094

Please sign in to comment.