GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: legitimize `SuppressedError` as primordial · nodejs/node@d994210

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • eslint.config_partial.mjs
    • internal
      • quic
        • quic.js
      • streams/iter
        • consumers.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/eslint.config_partial.mjs‎

Copy file name to clipboardExpand all lines: lib/eslint.config_partial.mjs
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const noRestrictedSyntax = [
2323
message: "`btoa` supports only latin-1 charset, use Buffer.from(str).toString('base64') instead",
2424
},
2525
{
26-
selector: 'NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError|NodeAggregateError|QuicError|QuotaExceededError)$/])',
26+
selector: 'NewExpression[callee.name=/Error$/]:not([callee.name=/^(AssertionError|NghttpError|AbortError|NodeAggregateError|QuicError|QuotaExceededError|SuppressedError)$/])',
2727
message: "Use an error exported by 'internal/errors' instead.",
2828
},
2929
{
@@ -507,6 +507,7 @@ export default [
507507
into: 'Safe',
508508
},
509509
{ name: 'String' },
510+
{ name: 'SuppressedError' },
510511
{ name: 'Symbol' },
511512
{ name: 'SyntaxError' },
512513
{ name: 'TypeError' },
Collapse file

‎lib/internal/quic/quic.js‎

Copy file name to clipboardExpand all lines: lib/internal/quic/quic.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const {
1919
PromisePrototypeThen,
2020
PromiseWithResolvers,
2121
SafeSet,
22+
SuppressedError,
2223
Symbol,
2324
SymbolAsyncDispose,
2425
SymbolAsyncIterator,
@@ -1231,14 +1232,12 @@ function invokeOnerror(fn, error) {
12311232
if (isPromise(result)) {
12321233
PromisePrototypeThen(result, undefined, (err) => {
12331234
process.nextTick(() => {
1234-
// eslint-disable-next-line no-restricted-syntax
12351235
throw new SuppressedError(err, error, err?.message);
12361236
});
12371237
});
12381238
}
12391239
} catch (err) {
12401240
process.nextTick(() => {
1241-
// eslint-disable-next-line no-restricted-syntax
12421241
throw new SuppressedError(err, error, err?.message);
12431242
});
12441243
}
Collapse file

‎lib/internal/streams/iter/consumers.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/iter/consumers.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const {
2222
PromisePrototypeThen,
2323
SafePromiseAllReturnVoid,
2424
SafeSet,
25+
SuppressedError,
2526
Symbol,
2627
SymbolAsyncIterator,
2728
TypedArrayPrototypeGetBuffer,
@@ -645,7 +646,6 @@ async function cleanupIterators(iterators, primaryError, pendingPulls) {
645646
// Both a primary error and a cleanup error occurred.
646647
// Wrap in SuppressedError so neither is lost:
647648
// .error = primaryError, .suppressed = cleanupError.
648-
// eslint-disable-next-line no-restricted-syntax
649649
throw new SuppressedError(primaryError, cleanupError);
650650
}
651651
// No primary error - the cleanup error is the only error.

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.