node icon indicating copy to clipboard operation
node copied to clipboard

Update internal util isError with new Error.isError

Open miguelmarcondesf opened this issue 9 months ago • 4 comments

With Version 24.0.0 V8 will be updated to 13.4 and Error.isError will be available, with that we can update the way we check if an object is an error in some places.

Following @jasnell suggestion in @geeksilva97 PR https://github.com/nodejs/node/pull/55406, I would like to start some issues regarding where this change is necessary, starting with the isError present in lib/internal/util

miguelmarcondesf avatar Apr 21 '25 17:04 miguelmarcondesf

We should probably deprecate util.types.isNativeError as well as of v24?

ljharb avatar Apr 21 '25 17:04 ljharb

I remember deprecating all the all the util.is functions. util.isError is in fact EOL https://nodejs.org/api/deprecations.html#DEP0048 If its not used anywhere in the codebase it can be removed

marco-ippolito avatar Apr 22 '25 05:04 marco-ippolito

I remember deprecating all the all the util.is functions. util.isError is in fact EOL https://nodejs.org/api/deprecations.html#DEP0048 If its not used anywhere in the codebase it can be removed

You're right about that, but this one is related to isError from the internal helper.

miguelmarcondesf avatar Apr 22 '25 15:04 miguelmarcondesf

We should probably deprecate util.types.isNativeError as well as of v24?

FWIW, I'm seeing a 50% performance regression for Error.isError over the current util/types IsNativeError binding in the latest build.

Renegade334 avatar May 02 '25 14:05 Renegade334