summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/internal/errors.ts
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-06-18 16:16:13 +0530
committerGitHub <noreply@github.com>2024-06-18 10:46:13 +0000
commit8c4b33db0d05181a0e5538bddaf063144724c938 (patch)
tree368ced63a6ac484db822212d9d332d92bd3466ed /ext/node/polyfills/internal/errors.ts
parent4b83ce8acabaf868d47bf764fce18ce5450fd314 (diff)
feat(ext/node): add BlockList & SocketAddress classes (#24229)
Closes https://github.com/denoland/deno/issues/24059
Diffstat (limited to 'ext/node/polyfills/internal/errors.ts')
-rw-r--r--ext/node/polyfills/internal/errors.ts14
1 files changed, 2 insertions, 12 deletions
diff --git a/ext/node/polyfills/internal/errors.ts b/ext/node/polyfills/internal/errors.ts
index cb4119411..6529e9894 100644
--- a/ext/node/polyfills/internal/errors.ts
+++ b/ext/node/polyfills/internal/errors.ts
@@ -667,9 +667,7 @@ function invalidArgTypeHelper(input: any) {
return ` Received type ${typeof input} (${inspected})`;
}
-export class ERR_OUT_OF_RANGE extends RangeError {
- code = "ERR_OUT_OF_RANGE";
-
+export class ERR_OUT_OF_RANGE extends NodeRangeError {
constructor(
str: string,
range: string,
@@ -694,15 +692,7 @@ export class ERR_OUT_OF_RANGE extends RangeError {
}
msg += ` It must be ${range}. Received ${received}`;
- super(msg);
-
- const { name } = this;
- // Add the error code to the name to include it in the stack trace.
- this.name = `${name} [${this.code}]`;
- // Access the stack to generate the error message including the error code from the name.
- this.stack;
- // Reset the name to the actual name.
- this.name = name;
+ super("ERR_OUT_OF_RANGE", msg);
}
}