Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18, 20, 22]
node-version: [24, 26]
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -21,22 +21,3 @@ jobs:
run: npm ci
- name: Test / Lint / Codestyle
run: make all
test-optional:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [24]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
continue-on-error: true
- name: Test / Lint / Codestyle
run: make all
continue-on-error: true
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change log

## 9.0.0-rc.0

- BREAKING: upgrade to `@netflix/nerror@2.0.0-rc.0`, which drops the legacy
`.cause()` function in favor of the spec `Error.prototype.cause` property.
`lib/serializer.js` and `lib/baseClasses/HttpError.js` now read `err.cause`
as a property instead of invoking it as a function.

## 7.0.0

- BREAKING: omit node domains from serializer
Expand Down
7 changes: 3 additions & 4 deletions lib/baseClasses/HttpError.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ HttpError.prototype.toJSON = function toJSON() {
var message = '';

// if we have a cause, get the full VError toString() without the current
// error name. verbose check, self.cause can exist but returns undefined
if (self.cause && typeof self.cause === 'function' && self.cause()) {
// error name.
if (self.cause) {
var fullString = self.toString();
message = fullString.substr(fullString.indexOf(' ') + 1);
} else {
Expand All @@ -159,8 +159,7 @@ HttpError.prototype.toJSON = function toJSON() {

return {
code: self.body.code,
message: message,
cause: self.cause
message: message
};
};

Expand Down
4 changes: 2 additions & 2 deletions lib/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function _getMultiErrorStack(err) {


/**
* loop through all cause() errors and build a stack trace output
* loop through all cause errors and build a stack trace output
* @private
* @method _getFullErrorStack
* @param {Object} err an error object
Expand All @@ -94,7 +94,7 @@ function _getFullErrorStack(err) {

out += stackString.shift() + self._getSerializedContext(e);
out += stackString.join('\n');
e = (typeof e.cause === 'function') ? e.cause() : null;
e = e.cause || null;
first = false;
} while (e);

Expand Down
Loading