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

Store error context via cls and async_hooks #37

Open
CheerlessCloud opened this issue Oct 6, 2019 · 0 comments
Open

Store error context via cls and async_hooks #37

CheerlessCloud opened this issue Oct 6, 2019 · 0 comments

Comments

@CheerlessCloud
Copy link
Owner

I think with cls-hooked we can provide interface something like this:

EError.bindContext({ tracingId: 42 }, () => next());

// ------- in next middleware ----------

process.nextTick(() => {
  try {
    throw new EError('Something went wrong');
  } catch (err) {
    assert(err.tracingId === 42);
  }
});

Looks good, in my view 👀 Need PoC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant