MCPcopy Create free account
hub / github.com/nodejs/undici / onResponseError

Method onResponseError

lib/api/api-stream.js:224–245  ·  view source on GitHub ↗
(_controller, err)

Source from the content-addressed store, hash-verified

222 }
223
224 onResponseError (_controller, err) {
225 const { res, callback, opaque, body } = this
226
227 removeSignal(this)
228
229 this.factory = null
230
231 if (res) {
232 this.res = null
233 util.destroy(res, err)
234 } else if (callback) {
235 this.callback = null
236 queueMicrotask(() => {
237 this.runInAsyncScope(callback, null, err, { opaque })
238 })
239 }
240
241 if (body) {
242 this.body = null
243 util.destroy(body, err)
244 }
245 }
246}
247
248function stream (opts, factory, callback) {

Callers 1

constructorMethod · 0.95

Calls 2

removeSignalFunction · 0.85
destroyMethod · 0.45

Tested by

no test coverage detected