Skip to content

Replace cause method to property usage in README - #29

Open
ivanmartynau-oss wants to merge 1 commit into
Netflix:masterfrom
ivanmartynau-oss:ivanmartynau-READme-adjustment
Open

Replace cause method to property usage in README#29
ivanmartynau-oss wants to merge 1 commit into
Netflix:masterfrom
ivanmartynau-oss:ivanmartynau-READme-adjustment

Conversation

@ivanmartynau-oss

@ivanmartynau-oss ivanmartynau-oss commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • The README showed err.cause() as an instance method, which does not exist and throws TypeError.
  • cause on a VError instance is a property (err.cause). The static helper remains VError.cause(err).
  • Update the quick-start example to err.cause.message so it matches lib/verror.js.
const err = new VError(err1, 'stat "%s"', filename);

err.cause                    // the Error object (or undefined if none)
VError.cause(err)            // same Error, or null if none
err.cause()                 // TypeError

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