Skip to content

fix!: use spec Error.cause property instead of legacy cause() function - #112

Open
mason-albert wants to merge 1 commit into
masterfrom
masona/nerror-v2
Open

fix!: use spec Error.cause property instead of legacy cause() function#112
mason-albert wants to merge 1 commit into
masterfrom
masona/nerror-v2

Conversation

@mason-albert

@mason-albert mason-albert commented Jul 30, 2026

Copy link
Copy Markdown

@netflix/[email protected] replaces the non-standard cause() method with the native Error.cause property. Update HttpError.toJSON() and the serializer's cause-chain walk accordingly, and fix a latent bug where toJSON() was serializing the cause function reference itself rather than a value.

As a follow-up, the devDependencies on restify and restify-clients should be updated after the next major release of those libraries. Until then, nerror's tests will fail on node 24 and node 26.

@mason-albert
mason-albert force-pushed the masona/nerror-v2 branch 2 times, most recently from 1852ea2 to c326393 Compare July 31, 2026 17:34
@netflix/[email protected] replaces the non-standard cause() method with
the native Error.cause property. Update HttpError.toJSON() and the
serializer's cause-chain walk accordingly, and fix a latent bug where
toJSON() was serializing the cause function reference itself rather
than a value.

BREAKING CHANGE: Error instances no longer expose .cause() as a callable
function. Consumers must access the spec-compliant .cause property
instead. Bump @netflix/nerror dependency/override to ^2.0.0-rc.0 and
package version to 9.0.0-rc.0 accordingly.
@mason-albert mason-albert changed the title fix: use spec Error.cause property instead of legacy cause() function fix!: use spec Error.cause property instead of legacy cause() function Jul 31, 2026
@mason-albert
mason-albert marked this pull request as ready for review July 31, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant