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

Huge debugging improvement (show enumerable error properties) #884

Closed
4 tasks done
aalexgabi opened this issue Mar 2, 2022 · 1 comment
Closed
4 tasks done

Huge debugging improvement (show enumerable error properties) #884

aalexgabi opened this issue Mar 2, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@aalexgabi
Copy link

Clear and concise description of the problem

Error enumerable properties are not shown for test case:

import { test } from 'vitest';

test('throw error with context', () => {
  const err = new Error('This is an error with context');
  err.userId = 32;
  err.companyId = 64;
  throw err;
})

image

Suggested solution

Show enumerable properties on errors as node does by default:
image

Alternative

At the very least please add an option to opt in for this behavior.

Additional context

When calling a function transformSomething(array) the function might have many iterations inside but one iteration will fail becaue the item may be invalid. It's very useful when throwing an error, especially for logging to specify which iteration failed.

For more context here is the equivalent issue for chromium dev tools console https://bugs.chromium.org/p/chromium/issues/detail?id=1251322&q=enumerable&can=2

Validations

@aalexgabi aalexgabi changed the title Huge debugging improvement Huge debugging improvement (show enumerable error properties) Mar 2, 2022
@sheremet-va sheremet-va added enhancement New feature or request good first issue Good for newcomers labels Mar 8, 2022
@sheremet-va
Copy link
Member

Resolved in #1202

@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants