fix(ext/node): use ERR_NOT_IMPLEMENTED for notImplemented (#26853)

This commit is contained in:
Divy Srivastava 2024-11-13 19:47:01 +05:30 committed by GitHub
parent 9331e2cef0
commit 7d9ba09f5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 3 deletions

View file

@ -17,6 +17,7 @@ const {
import { TextDecoder, TextEncoder } from "ext:deno_web/08_text_encoding.js";
import { errorMap } from "ext:deno_node/internal_binding/uv.ts";
import { codes } from "ext:deno_node/internal/error_codes.ts";
import { ERR_NOT_IMPLEMENTED } from "ext:deno_node/internal/errors.ts";
export type BinaryEncodings = "binary";
@ -34,8 +35,7 @@ export type TextEncodings =
export type Encodings = BinaryEncodings | TextEncodings;
export function notImplemented(msg: string): never {
const message = msg ? `Not implemented: ${msg}` : "Not implemented";
throw new Error(message);
throw new ERR_NOT_IMPLEMENTED(msg);
}
export function warnNotImplemented(msg?: string) {