Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested errors are still not serialized #74

Closed
fregante opened this issue May 5, 2022 · 0 comments · Fixed by #73
Closed

Nested errors are still not serialized #74

fregante opened this issue May 5, 2022 · 0 comments · Fixed by #73

Comments

@fregante
Copy link
Collaborator

fregante commented May 5, 2022

I was thrown off by this test:

serialize-error/test.js

Lines 129 to 136 in 6f6102f

test('should serialize nested errors', t => {
const error = new Error('outer error');
error.innerError = new Error('inner error');
const serialized = serializeError(error);
t.is(serialized.message, 'outer error');
t.is(serialized.innerError.message, 'inner error');
});

This is incorrect. The test is not testing whether the property was serialized, but whether it exists. The nested error is there still as an Error instance.

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 a pull request may close this issue.

1 participant