MCPcopy Index your code
hub / github.com/nodejs/node / onFrameError

Function onFrameError

lib/internal/http2/core.js:663–683  ·  view source on GitHub ↗
(id, type, code)

Source from the content-addressed store, hash-verified

661// Called by the native layer when an error has occurred sending a
662// frame. This should be exceedingly rare.
663function onFrameError(id, type, code) {
664 const session = this[kOwner];
665 if (session.destroyed)
666 return;
667 debugSessionObj(session, 'error sending frame type %d on stream %d, code: %d',
668 type, id, code);
669
670 const stream = session[kState].streams.get(id);
671 const emitter = stream || session;
672 emitter[kUpdateTimer]();
673 emitter.emit('frameError', type, code, id);
674
675 // When a frameError happens is not uncommon that a pending GOAWAY
676 // package from nghttp2 is on flight with a correct error code.
677 // We schedule it using setImmediate to give some time for that
678 // package to arrive.
679 setImmediate(() => {
680 stream?.close(code);
681 session.close();
682 });
683}
684
685function onAltSvc(stream, origin, alt) {
686 const session = this[kOwner];

Callers

nothing calls this directly

Calls 5

debugSessionObjFunction · 0.85
getMethod · 0.65
closeMethod · 0.65
setImmediateFunction · 0.50
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…