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

Method fail

lib/internal/quic/quic.js:2295–2319  ·  view source on GitHub ↗
(reason)

Source from the content-addressed store, hash-verified

2293 }
2294
2295 function fail(reason) {
2296 if (closed || errored) return;
2297 errored = true;
2298 error = reason ?? new ERR_INVALID_STATE('Failed');
2299 // `writer.fail()` is always an error path, so the wire code on
2300 // RESET_STREAM must never be `0n` (which means "no error" in
2301 // most application protocols). Resolve the code in priority
2302 // order:
2303 // 1. If `reason` is a `QuicError`, use its explicit
2304 // `errorCode`.
2305 // 2. Otherwise fall back to the negotiated application's
2306 // "internal error" code, surfaced via
2307 // `QuicSessionState.internalErrorCode`. For HTTP/3 this is
2308 // `H3_INTERNAL_ERROR` (0x102); for raw QUIC applications
2309 // it falls back to the QUIC transport-layer
2310 // `INTERNAL_ERROR` (0x1).
2311 const code = QuicError.isQuicError(error) ?
2312 error.errorCode :
2313 getQuicSessionState(stream.#inner.session).internalErrorCode;
2314 handle.resetStream(code);
2315 if (drainWakeup != null) {
2316 drainWakeup.reject(error);
2317 drainWakeup = null;
2318 }
2319 }
2320
2321 const writer = {
2322 __proto__: null,

Callers 15

_http_agent.jsFile · 0.45
deserializeErrorFunction · 0.45
writeNumericArgFunction · 0.45
[kOnMessage]Method · 0.45
generateKeyImplFunction · 0.45
deriveBitsImplFunction · 0.45
deriveKeyImplFunction · 0.45
signVerifyFunction · 0.45
cipherOrWrapFunction · 0.45
encapsulateBitsImplFunction · 0.45
encapsulateKeyImplFunction · 0.45
decapsulateBitsImplFunction · 0.45

Calls 3

isQuicErrorMethod · 0.80
resetStreamMethod · 0.80
rejectMethod · 0.80

Tested by

no test coverage detected